问题
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 %>
回答1:
Can you just use Hash#merge?, something like:
<% link_to mylist_url(params.merge(:se=>"true")) do %> ... <% end %>
来源:https://stackoverflow.com/questions/4112425/rails-is-there-a-shortcut-to-pass-all-existing-params