I'm trying to save the site that a user came from when they sign up.
Right now I have a before_filter in my ApplicationController:

before_filter :save_referer

  def save_referer
    unless is_logged_in?
      session['referer'] = request.env["HTTP_REFERER"] unless
session['referer']
    end
  end


def create
@user = User.new(params[:user])
if @user.save_with(session[:referer]) .... end

User def save_with(referer) self.referer = referer unless referer ==
"null" self.save
end

Then when a user is created, it checks this session variable and sets
it to nil. This is buggy as it only works sometimes and I cannot seem
to figure out why.  Any ideas what could be going on?

-- 
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.

Reply via email to