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
Post a Comment