2

I have a partial _filter.html.erb which uses simple-form. The first line is:

<%= simple_form_for :filter, url: index_panel_path, :method => "get", :html => { :id => "search_by_id"} do |f| %>

So, on click filter button, it calls index_panel_path with params[:filter]. The index.html.erb has this line:

<li><a href=<%= grocery_panel_path %> >Grocery Panel</a></li>

This calls the grocery_panel method in the controller. The problem is that I am getting the params[:filter] in index.html, but in the grocery method the params[:filter] is nil. Any idea how can I send the params there?

Hellboy
  • 1,199
  • 2
  • 15
  • 33

1 Answers1

4

Pass it manually like:-

<li><a href=<%= grocery_panel_path(:filter => "some_value") %> >Grocery Panel</a></li>
Abhi
  • 4,123
  • 6
  • 45
  • 77