ruby on rails - Add param to link_to show method -


i have current code in traders.index.html file

<ul> <% @traders.each |trader| %>   <li><%= link_to trader.name, trader %></li> <%end%> </ul> 

i want add parameter sent through, tried

<li><%= link_to trader.name, trader, {:restricted => params[:s]} %></li> 

but doesn't send parameter, whats actual format of link_to done?

you can do:

<%= link_to trader.name, trader_path(trader, restricted: params[:s]) %> 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -