Rails - Is there a shortcut to pass all existing parameters?

How can you pass all parameters to a controller action?

# instead of: <%= link_to mylist_url(id: params[:id], se: "true", st: params[:st], re: params[:re], li: params[:li]) do %> ... <% end %> # something like: <% link_to mylist_url(params: :all, se: "true") do %> ... <% end %> 
+2
source share
1 answer

Can you just use the hash # merge ? Example:

 <% link_to mylist_url(params.merge(:se=>"true")) do %> ... <% end %> 
+6
source

Source: https://habr.com/ru/post/890911/


All Articles