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

Hi,

   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 = Contact.new(params[:id])
             @contact.attributes = params[:contact]
             @contact.save!
             redirect_to :action => "index"
       end

Below is the complete error stack,

maddy wrote:

I think you are updating @contact
@contact.update_attributes(params[:contact])

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

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

This should be Contact.find

Fred

Hi Fred,

   Thanks a lot!

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

Regards,
maddy