Im trying to redirect the user after the sign up by saving the referer
in case when user came to sign up through clicking on any specific page.
But its not working properly.
I'm using Devise, and i have 2 step registration, after sign up user
redirects to profile completion and it is mandatory and after that im
redirecting to referer. Please tell me what is the problem ?
In my application controller,
before_filter : save_referer
def save_referer
unless user_signed_in?
unless session['referer']
session['referer'] = request.referer || 'none'
end
end
end
In User Model,
def save_with(referer)
referer = referer unless referer == "null"
self.save
end
Initally i did self.referer but then i got undefined method `referer='
for #<User:0xc4a8bf0>
Here im saving it,
if current_user.sign_in_count <= 1
if current_user.save_with(session[:referer])
redirect_to session[:referer]
else
redirect_to any_other
end
end
···
--
Posted via http://www.ruby-forum.com/.