I want to make a back link that will link to the controller index.
<%= link_to 'Back', employee_personals_path%>
It works.
But in index i want to send user id also.
<%= link_to 'Back', { :action => "index", :user_id => @user_id},
{:class=>"btn btn-success"}%>
This works.
Now i want to implement sending user_id by first method
<%= link_to 'Back', employee_personals_path, :user_id => @user_id%>
But it does not works. How can i make it work?
You need to pass a parameter to your employee_personals_path function (not to link_to):