Displaying 5 results from an estimated 5 matches for "authorization_token".
2012 Apr 25
8
showing error (gsub) when switching from session to cookies
...sif 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] = {
:value => user.authorization_token,
:expires => 10.years.from_now }
else
cookies.delete(:remember_me)
cookies.delete(:authorization_token)
end
flash[:notice] = "User #{user.screen_name} logged in!"
redirect_to_forwarding_url
e...
2010 Jul 31
4
Exception: can't dup Symbol
Hey everybody,
I''m trying to test a little piece of code I wrote, and I get the
following error:
Exception: can''t dup Symbol
It happens in the following line: try_to_login @valid_user, :remember_me
=> "1",
where the function try_to_login is:
def try_to_login(user, options = {})
user_hash = {:screen_name => user.screen_name, :password =>
user.password}
2009 Apr 29
7
problem with nil.user
Hi all, I''ve put new code into my app so that an administrator will have
extra privileges (administer users, edit pages). The error is:
''Couldn''t find User without an ID''
So the app is looking for a logged in user when the homepage is
accessed.
Heres my code:
site/index view:
<% if is_logged_in? and logged_in_user.has_role?(''Moderator'')
2008 May 15
0
partial_updates feature in rails 2.1, failing to save because of validate_presence _of on other attributes in the table
...ser.find_by_screen_name(''vince888'')
=> #<User id: 1, screen_name: "vince888", password: "vince888", email:
"vince-wop0JeY5JKhWk0Htik3J/w@public.gmane.org", created_at: "2008-05-15 12:35:12", updated_at:
"2008-05-15 13:03:38", authorization_token: nil>
>> @user.spec.city_of_birth
=> "Wichita"
>> @user.spec.city_of_birth = ''Charleston''
=> "Charleston"
>> @user.spec.changes
=> {"city_of_birth"=>["Wichita", "Charleston"]}
>> @user.spec.sa...
2008 Oct 08
2
private method `gsub' called for 2:Fixnum
RoR Error: “private method `gsub'' called for 2:Fixnum”
I am new to RoR and trying to complete “RailsSpace Social Networking”
example, all works fine until I have implemented cookies using
authorization_token, and start getting following error when trying to
login.
“private method `gsub'' called for 2:Fixnum”
I can make out that there is something related to String conversion
but not sure go forward to resolve this.
--~--~---------~--~----~------------~-------~--~----~
You received this messa...