title: Ruby on Rails passing of parameters between views from link_to tag instead of submit_tags (having both on page)
body: <p>I'm creating in my index page of my ruby on rails program, a list of the most commonly searched for terms in my database and hence each time a user selects a specific category this is written to another database.</p>
  
  <p>What i would like it to create a hyperlink and pass a certain amount of parameters to a form like is usually done with a select_tag but instead with just a hyperlink, i would like to pass a set of hidden fields that i have on the page as well as what the user has selected.</p>
  
  <p>To give you a better idea, basically i have the following structure in my program:</p>
  
  <p>User inputs a search on (<code>index.html.erb</code>), user clicks on submit tag 
  action, user is taken to <code>search.html.erb</code> page and is displayed a set of refined categories + some fields, submit button, </p>
  
  <p>user is taken to <code>closest.html.erb</code> (which uses parameters from the previous form by invoking the <code>params[:searchSelected]</code> and a few other params. )</p>
  
  <p>I would also like to add this functionality:
  Mimick this same operation, but instead of going in the <code>search.html.erb</code>, i would click on an already refined search category on the <code>index.html.erb</code> page (from a <code>link_to</code> , transmit as parameters which link_to the user has chosen + the hidden fields.</p>
  
  <p>i Currently have this code</p>
  
  <pre><code>@stats.each do
  |scr|%&gt;
  &lt;%= link_to scr.category,  :action =&gt; 'closest', :id =&gt; scr.category%&gt;
  </code></pre>
  
  <p>I'm not sure if this is relevant, but i currently have the following routes in my <code>routes.rb</code> file</p>
  
  <pre><code> map.resources :stores, :collection =&gt; { :search =&gt; :get }
  
   map.connect ':controller/:action/:id'
   map.connect ':controller/:action/:id.:format'
  </code></pre>
  
  <p>would anyone please assist me please? this is my first ruby on rails project and i would really like to find a way around this please</p>