How can i have a link on a page that takes the user to another URL and passes along a parameter and on the target url how can we pick up that parameter.
usually I add links like following:
<%= link_to "Add Product", '/pages/product' %>
But how can I send parameters along with this url? Can I pick them in the target action by using params[:parm_name]
Just add them to link:
and in controller:
If you use helper methods for routes (for example
company_path), then you can add hash of params, so this two should be similar:From documentation: