0

So I'm trying to do something like this:

<% if :back == 'static_pages#game' %>
...do something...
<% if :back == 'static_pages#laugh' %>
...do something else...

I'm trying to get the URL where the action came from, and depending on where it came from, do something. It definitely does not work the way I'm doing it.

Flexo
  • 87,323
  • 22
  • 191
  • 272
apuente
  • 47
  • 5

1 Answers1

0

You can access the request referrer, for example with:

<% if URI(request.referer).path == '/game' %>

More info in: Rails 3 get request referrer

Community
  • 1
  • 1
kcdragon
  • 1,724
  • 1
  • 14
  • 23