request.referer
returns a string, but you can use Ruby’s URI Module to wrap it and then simply ask it for its path:
if URI(request.referer).path == '/adsense'
More Related Contents:
- Format a string containing Phone numbers
- SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
- How to understand nil vs. empty vs. blank in Ruby
- How do I get the current absolute URL in Ruby on Rails?
- redirect_to using POST in rails
- Rails 4: List of available datatypes
- ActiveRecord.find(array_of_ids), preserving order
- In Ruby on Rails, how do I format a date with the “th” suffix, as in, “Sun Oct 5th”?
- Rails: Access to current_user from within a model in Ruby on Rails
- What’s the best way to use SOAP with Ruby?
- Rails: ActiveRecord query based on association value
- Rails update_attributes without save?
- how to solve “ruby installation is missing psych” error?
- Detect MIME type of uploaded file in Ruby
- How can I find out the current route in Rails?
- Using send_file to download a file from Amazon S3?
- How to use ActiveRecord in a ruby script outside Rails?
- Uploading multiple files with paperclip
- Rails 3.1 and Ruby 1.9.3p125: ruby-debug19 still crashes with “Symbol not found: _ruby_threadptr_data_type” [duplicate]
- Using helpers in model: how do I include helper dependencies?
- How to change the default path of view files in a Rails 3 controller?
- Rails I18n validation deprecation warning
- Rails each loop insert tag every 6 items?
- Validation failed: Upload file has an extension that does not match its contents
- Why can’t I install the SQLite gem?
- Error message: Make sure that `gem install pg -v ‘0.18.1’` succeeds before bundling
- Adding foreign key to a rails model
- RVM installed by Ruby not working?
- Rails 4.0 expire_fragment/cache expiration not working
- using has_many :through and build