Are params reset after a frame rendering?

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.

Thing is, simple_calendar gem uses theses helpers to create “Previous” and “Next” (months, weeks, …) links:

  @params.merge(start_date_param => (date_range.first -

causing “Previous” and “Next” hrefs to includes the previously POSTed params:


instead of


which point to /events !

Question is, should I manually reset the parameters on a turbo_frame rendering ? I believe I should, but how ?

I’ve tried params = nil and request.parameters.delete('event'), but params keeps being merged.

Thanks for this amazing lib btw !

Things always look better in the morning (and after reading the doc and understanding it a bit better).

I believe I’m overusing <turbo-stream action="replace"> tags and didn’t consider this part of the doc:

The replace visit action uses history.replaceState to discard the topmost history entry and replace it with the new location.

On my way to re-read the docs, find another approach and post update here

1 Like