link_to param scoping in rails?
I have a page which has a couple option links that set GET-based parameters to the page.
These links are created with the Rails HtmlHelper:
link_to section, {:company_id => params[:company_id], :view => section}
Notice how I have to retype out parameters just in case they've been selected before.
I want to know if I can achieve 开发者_StackOverflow中文版this same effect, to automatically account for all parameters so it's just easier to write and read.
You could try something like
link_to section, params.merge({ :view => section })
精彩评论