I uses Rails erb to create links, like the following:
<% link_to item_path(topic.company, topic, :area => params[:area]) do %>
However now I need to add some condition, when it fulfills I want to pass additional parameters to the item_path function. like:
<% link_to item_path(topic.company, topic, :area => params[:area], :utm_source => "top") do %>
I guess Ruby probably has a way to add additional parameters since parameter passing is essentially a hash right? Is there an cool way to do this, instead of an if-else statement calling item_path with different set of parameters (like in Java?).
P.S. I tried have one extra hash with the additional parameter and append it into the functional call, like the following. But it didn't work.
<% link_to item_path(topic.company, topic, :area => params[:area], additional_param) do %>