I have this code:
def addcar
@car = Car.new(params[:car])
render :action => \'list\'
end
<% @allcars.each do |cell| %>
<%= l
in the addcar
method, you try to create a new object (create
method) while transfering just a string to it (params[:car]
which apparently is set to "Honda").
create
expects to get an attributes hash and to stringify it's keys for
the column names.
If you have a column named name in your cars table then try this:
@car = Car.new(:name => params[:car])