Reputation: 679
I have the current code in my traders.index.html file
<ul>
<% @traders.each do |trader| %>
<li><%= link_to trader.name, trader %></li>
<%end%>
</ul>
I want to add an extra parameter to be sent through, I tried
<li><%= link_to trader.name, trader, {:restricted => params[:s]} %></li>
But this doesn't send the parameter, whats the actual format of the link_to to get this done?
Upvotes: 0
Views: 28
Reputation: 51151
You can do:
<%= link_to trader.name, trader_path(trader, restricted: params[:s]) %>
Upvotes: 4