Rails - how to use request referrer to limit access to a view based on referrer -


i've been looking around can't seem find solution i'm trying do.

i have 'thankyou' view routed custom controller action. want restrict access view case user came view user submitted form since don't want users able navigate directly view.

how write controller code accomplish in custom controller action?

in controller can do:

def thankyou   if request.referrer != "http://mysite.com/myformpage"     redirect_to root_path, notice: "invalid access"   end end 

or can create before_filter action same logic


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -