undefined method `stringify_keys!’ ruby on rails

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])

Leave a Comment