Ruby On Rails: access link_to parameter in controller -


Say that there are two buttons in the index view of my model which is used to create a new instance of the model. I want to pass the variable : number for my controller and use it in the new function so that I depend on how the button was pressed, its On the basis I can change a bit. How can I access : number in the controller?

  & lt;% = link_to 'New Run1', new_test_suite_run_path ,: class = & gt; "BTN BTN-Custom 1" ,: number = & gt; 1%> & Lt;% = link_to 'New Run 2', new_test_suite_run_path ,: class = & gt; "BTN BTN-Custom 1" ,: number = & gt; 2% & gt;    

Do it instead

& lt; % = Link_to 'New Run1', new_test_suite_run_path (: number = gt; 1) ,: class = & gt; "BTN BTN-Custom 1"%>

and then in your Controller my_number = params [: number]

Comments