Skip to content

How to update url params when refreshing the partial. #154

Description

@donotresist

Hi, I have a page with a couple of divs rendering content asynchronously in the initial page load.

I also have a filter at the top of the page that when clicked is supposed to refresh the contents.

= render 'shared/filter'

= render_async scores_path(filter: "overall"), container_class: "filterable_report" do
     = render partial: 'loader'
     
= render_async metrics_path(filter: "overall"), container_class: "filterable_report" do
     = render partial: 'loader'

When a different filter is selected, I would like to refresh the partial by making call to the url with the updated filter param. I think the best way to go about this is by refreshing the partials perhaps. But I am confused on how to update the params value itself. I am aware, I can pass the params like this as well.

= render_async scores_path, data: { filter: 'overall' } do
   = render partial: 'loader'

So, is there a way to update the data or even the url when dispatching the refresh event? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions