ruby on rails - How to use variable from link -


i have link reads

<a href="<%= user_collections_path(@user, :status => "got") %>">collection</a> 

and reads

<a href="<%= user_collections_path(@user, :status => "want") %>">wantlist</a> 

they link same view produce different lists. on view page want able alter text depending on if collection or wantlist page. this:

<% if :status == 'got' %>collection<% elsif :status == 'want' %>wantlist<% end %> 

obviously doesn't work after experimentation can't work out how query status passed in link. possible?

you should doing this

<% if params[:status] == 'got' %>collection  <% elsif params[:status] == 'want' %>wantlist  <% end %> 

Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -