Thriving K.
2009-Sep-24 02:33 UTC
How to generate password automatically using authlogic..
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 -- Posted via http://www.ruby-forum.com/.
Matt Jones
2009-Sep-24 21:46 UTC
Re: How to generate password automatically using authlogic..
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...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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 > -- > Posted viahttp://www.ruby-forum.com/.
Thriving K.
2009-Sep-25 02:57 UTC
Re: How to generate password automatically using authlogic..
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=-eTHPNk8gMIsNG5+lYJWuzQ@public.gmane.org_confirmation=random_password in controller before save -- Posted via http://www.ruby-forum.com/.