NoMethodError : undefined method `stringify_keys!' for "2":String


   I have been trying to create a small Rails application. In one of
the steps, I am facing this error as "NoMethodError in
ContactController#update ...... undefined method `stringify_keys!'
for "2":String".

  Let me give a brief description of the application. This application
is to Create, View and Update contacts. The problem came when updating
a record.

  The "Update" action in controller file looks like this,

       def update
             @contact =[:id])
             @contact.attributes = params[:contact]
             redirect_to :action => "index"

Below is the complete error stack,

maddy wrote:

I think you are updating @contact

The "Update" action in controller file looks like this,

   def update
         @contact = Contact\.new\(params\[:id\]\)

This should be Contact.find


Hi Fred,

   Thanks a lot!

   You were right. It had to be Contact.find.