User.random_string does not exists any more. So had to use *
SecureRandom.hex(10)*

On Friday, 27 July 2012 11:52:43 UTC+5:30, Sumit Srivastava wrote:
>
> I have been following following tutorial to make a user login session. 
>  http://www.aidanf.net/rails_user_authentication_tutorial
>
> I used the following action to encrypt the password.
>
>>   def password
>>     #debugger
>>     @password1=pass
>>     self.salt = SecureRandom.hex(10) if !self.salt?
>>     self.password = User.encrypt(@password1, self.salt)
>>   end
>>
>
> but when it is called following error is generated.
>
> SystemStackError (stack level too deep):
>>   app/models/user.rb:26:in `password='
>>   app/models/user.rb:27:in `password='
>>   app/controllers/user_controller.rb:31:in `new'
>>   app/controllers/user_controller.rb:31:in `createuser'
>>
>>
> I am not sure if this way of calling an action is correct or not. I need 
> help with this one asap. 
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/4s1gk_u2gWsJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to