On 25 April 2012 08:53, Amir Z. <[email protected]> wrote:
> Thanks Colin
> we are calling it as an object. Please find my login code below.
Which is the line generating the error?
Colin
>
> def login
> if request.get?
> @user = User.new(:remember_me => cookies[:remember_me] || "0")
> elsif param_posted?(:user)
> @user = User.new(params[:user])
> user = User.find_by_screen_name_and_password(@user.screen_name,
> @user.password)
> if user
> user.login!(session)
> if @user.remember_me == "1"
> cookies[:remember_me] = { :value => "1",
> :expires => 10.years.from_now }
> user.authorization_token = user.id
> user.save!
> cookies[:authorization_token] = { (line no. 27)
> :value => user.authorization_token, (line no. 28)
> :expires => 10.years.from_now } (line no. 29)
> else
> cookies.delete(:remember_me)
> cookies.delete(:authorization_token)
> end
> flash[:notice] = "User #{user.screen_name} logged in!"
> redirect_to_forwarding_url
> else
> @user.clear_password!
> flash[:notice] = "Invalid screen name/password combination"
> end
> end
> end
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
--
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.