On 17 June 2011 19:32, Adel Mediouni <mediouni.a...@gmail.com> wrote:
> hi
> when i want to update a user i have this error:
>
> ArgumentError in UsersController#update
>
> Unknown key(s): encrypted_password, username, sign_in_count, email
>
> Rails.root: /home/delmed/servadmin
>
> Application Trace | Framework Trace | Full Trace
> app/controllers/users_controller.rb:24:in `update'
> lib/chrome_frame.rb:39:in `call'
> Request
>
> Parameters:
>
> {"commit"=>"Modifier ce User",
>  "authenticity_token"=>"Z3PXWLIzHcu5nLm06ntenZA+yj8plf3kXrXQ17bjm2E=",
>  "_method"=>"put",
>  "utf8"=>"✓",
>  "id"=>"1",
>  "user"=>{"encrypted_password"=>"[FILTERED]",
>  "username"=>"user1",
>  "sign_in_count"=>"1",
>  "email"=>"us...@domaine0.com"}}
>
> in all these parametre are in the db in users table.
> in the controller i have:
> def edit
>    @user = User.find(params[:id])
>    render :layout => 'test'
>  end
>  def update
>
>    @user = User.find(params[:user])
>    if @user.update_attributes(params[:user])
>      falsh[:notice] = 'User was successfully updated.'

Not part of this problem but it should be flash not falsh

>
>    else
>        falsh[:notice] = 'Problem update.'

Same again

>    end
> ...

Can you post the section of db/schema.rb that shows the users table.
Also post user.rb (cut out any methods that are not relevant here, if
there are any)

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to