I am using Ruby On Rails 3.x
Multiple views of a controller call one and the same partial, as 90% of the partial is the same for all the views, the other 10% are handled via IF/ENDIF in the partial.
Now I need a link to the current URL and pass it a parameter, e.g. if the current URL ishttp://myapp.com/welcome/index_1 then I need a link to http://myapp/welcome/index_1?par=abcd
With
<%=link_to "Info",url_for(:only_path=>true)%>
I get the link to the current URL, but how to add the additional parameter.
<%=link_to "Info",url_for(:only_path=>true,:par=>"abcd")%>
isn’t working, neither is:
<%=link_to "Info",url_for(:only_path=>true), :par=>"abcd"%>
Try this