Using Hotwire &
simple_calendar gem on a project and I’m facing an interesting issue.
The app is a dead-simple calendar on which we can add events.
Each calendar’s cell has a “+” sign, which displays a modal containing
events/_form. On POST, the whole
calendar_frame is replaced so the newly created event is displayed. Works like a charm, even if it may not be optimized.
simple_calendar gem uses theses helpers to create “Previous” and “Next” (months, weeks, …) links:
view_context.url_for( @params.merge(start_date_param => (date_range.first - 1.day).iso8601) )
causing “Previous” and “Next” hrefs to includes the previously POSTed params:
which point to
Question is, should I manually reset the parameters on a turbo_frame rendering ? I believe I should, but how ?
params = nil and
request.parameters.delete('event'), but params keeps being merged.
Thanks for this amazing lib btw !