app/controllers/application_controller.rb
# Friendly forwarding works only for non logged in user and only for
# HTTP GET requests.
Friendly forwarding works only for non logged in user and only for
HTTP GET requests.
Friendly forwarding works only for non logged in user and only for HTTP GET requests .
def friendly_forwarding
    return if logged_in?
    store_intended_url
    flash[:danger] = 'You must be logged in.'
    redirect_to login_path
  end
def friendly_forwarding return if logged_in? store_intended_url flash [ :danger ] = 'You must be logged in.' redirect_to login_path end
Friendly forwarding works only for non logged in user and only for
HTTP GET requests.
Friendly forwarding works only for non logged in user and only for HTTP GET requests .
# Store for desired url for friendly forwarding.