Edit: For easier example, skip to EDIT part. Thanks !

I'm trying to implement a pretty simple thing into my app.

I have a view with a chart, which is based on two query params: :from and :to. I'm using "Chartkick" and these are my view and my controller.

index view (with a debug)

```
<%= params %>

<input type="text" id="from-date">
<%= column_chart dashboard_chart_path(:from => @from, :to => @to)  %>

```

controller

```
class DashboardController < ApplicationController
  def index
    @from = params[:from]
    @to = params[:to]
  end

  def call_from_ajax
    from = params[:from]
    to = params[:to]
    render action: 'index', to: to, from: from
  end

end

```

Everything works fine. When I type the query params in my URL, the chart displays the correct informations.
Now I have this JS code (for testing):

```
$(document).ready(function(){
    $('#from-date').pickadate({
      onClose: function() {
        array ={
          "from": "20-05-2018",
          "to": "01-05-2018"
        }
        $.ajax({
          type: 'GET',
          url: 'dashboard_chart_ajax',
          data: array
        })
      },
  });

```

route

```
get 'dashboard_chart_ajax', to: 'dashboard#call_from_ajax'

```

The ajax call works perfectly fine. My 'call\_from\_ajax' method is called and my console displays that the Index view has been rendered. But the params variable in my view do not update, neither the chart ... (I checked with byebug, params contains :from and :to values)
What am I missing ? Thanks in advance.

**EDIT:**

All content above is juste for practice. Let's take another example:

I added a route

```
get 'button', to: "dashboard#test"

```

My controller methods

```
def test
  redirect_to controller: :dashboard, action: :index, from: 'start_date', to: 'end_date'
end

def index
  @from = params[:from]
  @to = params[:to]
end

```

And a button in the view

```
<%= button_to "Some Button", button_path, method: :get, remote: true %>
<%= params %>

```

I want the params variable in the view to update when I click on the button.

When I first load the page, in the :index method I have:

```
 <ActionController::Parameters {"controller"=>"dashboard", "action"=>"index"} permitted: false>

```

When I click on the button, I have :

```
<ActionController::Parameters {"from"=>"start_date", "to"=>"end_date", "controller"=>"dashboard", "action"=>"index"} permitted: false>

```

But nothing is changing in the view...
It's so frustrating, but I'm learning and must be missing something.

My goal is to change a variable with my 'test' method, and then display it in the same view.

If somebody can help me, it would much appreciated.