This is what I receive,

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'

Here *createuser* action is used to store the user info into database.

Line 31 reads as follows,*
@user = User.new(params[:user])*

Regards
Sumit Srivastava

The power of imagination makes us infinite...


On 27 July 2012 16:00, Michael Pavling <pavl...@gmail.com> wrote:

> On 27 July 2012 11:13, sumit srivastava <sumit.theinvinci...@gmail.com>
> wrote:
> > During customizations I have used password as the column where encrypted
> > password shall be saved. So I created my own attr_accessor, i.e.,
> > passwordtext. I have named the password_field_tag in my form as
> > passwordtext. But when I do so, it is not executed. Instead if I rename
> the
> > password_field_tag and the attr_accessor as password only, it is executed
> > but the stackerror comes in.
>
> All of this info would have been very helpful in your OP.... anyway...
>
> ... what happens when you try this:
>
>   def passwordtext=(pass)
>     @passwordtext=pass
>     self.salt = User.random_string(10) if !self.salt?
>     self.password = User.encrypt(@passwordtext, self.salt)
>   end
>
> If it's still overflowing, can you post the error message again (since
> the model has changed since your first post this morning) and the
> corresponding method from the controller, as it might be something in
> there behaving weirdly.
>
> --
> 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 https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 https://groups.google.com/groups/opt_out.


Reply via email to