11175
(-- --)
1
I have problem , i want to generate password automatically
where can i manipulate :password and :confirm_password in action create
def create
@user = User.new(params[:user])
if @user.save
flash[:notice] = "Registration successful."
redirect_to root_url
else
render :action => 'new'
end
end
Matt_Jones
(Matt Jones)
2
Have you tried just setting @user.password and
@user.password_confirmation (or equivalent) before the @user.save
part?
--Matt Jones
11175
(-- --)
3
Matt Jones wrote:
Have you tried just setting @user.password and
@user.password_confirmation (or equivalent) before the @user.save
part?
--Matt Jones
On Sep 23, 10:33�pm, "Thriving K." <rails-mailing-l...@andreas-s.net>
Thank you, i can fix it now.
i have to put
= f.hidden_field :password,:value=>""
= f.hidden_field :password_confirmation,:value=>""
in form first and then i can type
@user.password=@user.password_confirmation=random_password in controller
before save