title: pass values from the view to the controller ruby on rails
body: <p>This is my controller:</p>
  
  <pre><code>def addcar
      @car = Car.new(params[:car])    
      render :action =&gt; "list"  
  end
  </code></pre>
  
  <p>this is my view:</p>
  
  <pre><code>&lt;%(@allcars).each do |cell|%&gt;
      &lt;p&gt;&lt;%= link_to cell.to_s, :controller =&gt; "car", :action =&gt; "addcar", :car =&gt; cell.to_s %&gt;&lt;/p&gt;
  &lt;%end %&gt;
  </code></pre>
  
  <p>In the <code>link_to</code> statement I want to pass <code>cell.to_s</code> to the controller. How can I do that please? The <code>cell.to_s</code> is just a string but I want it to be the name of the car object (<code>car.Name</code>)</p>