pass parameters through link_to in a list

Hello

I have the following situation This is my controller:

def addcar @car = Car.new(params[:car]) render :action => "list" endthis is my view: <%(@allcars).each do |cell|%>

<%= link_to cell.to_s, :controller => "car", :action => "addcar", :car => cell.to_s %>

<%end %>

In the link_to statement I want to pass cell.to_s to the controller. how can i do that please? THe cell.to_s is just a string but I want it to be the name of the car object (car.Name)

In other words I want to pass "Honda" to the controller so that I can save this to the cars table Id Name (Autogenerated) Honda (Autogenerated) Mercedes

etc

What is not working?

cell.name ? cell is the object, so .to_s method is going to print out the object summary

I didn’t add the routing properly :S

Now that i’m in my car controller, I want to call a view in the user views. How do i go from the controller to the view???

Thanks

use @car = Car.create( :name => params[:car]) ,

or @car = Car.find_or_create_by_name(params[:car])
if you don’t want duplicate items.