Class: Locomotive::Steam::Middlewares::Redirection

Inherits:
ThreadSafe
  • Object
show all
Includes:
Helpers
Defined in:
lib/locomotive/steam/middlewares/redirection.rb

Overview

When rendering the page, the developer can stop it at anytime by raising an RedirectionException exception. The exception message holds the url we want the user to be redirected to. This is specifically used by the authorize liquid tag.

Instance Attribute Summary

Attributes inherited from ThreadSafe

#env

Instance Method Summary collapse

Methods included from Helpers

#decorate_entry, #default_liquid_context, #default_locale, #html?, #json?, #liquid_assigns, #live_editing?, #locale, #locales, #log, #make_local_path, #modify_path, #mounted_on, #page, #params, #path, #redirect_to, #render_response, #repositories, #request, #services, #site

Methods inherited from ThreadSafe

#call, #next

Instance Method Details

#_callObject



13
14
15
16
17
18
19
# File 'lib/locomotive/steam/middlewares/redirection.rb', line 13

def _call
  begin
    self.next
  rescue Locomotive::Steam::RedirectionException => e
    redirect_to e.url, 302
  end
end