Displaying 1 result from an estimated 1 matches for "try_to_update".
2007 Aug 09
3
method_missing error......need some eyes for this one
..._________________________
user_controller.rb
#Edit the user''s basic info.
def edit
@title = "Edit your User Information"
@user = User.find(session[:user_id])
if param_posted?(:user)
attribute = params[:attribute]
case attribute
when "email"
try_to_update @user, attribute
when "password"
if @user.correct_password?(params)
try_to_update @user, attribute
else
@user.password_errors(params)
end
end
end
#For security purposes, never fill in the password fields.
@user.clear_password
end
# Try to...