Class: Locomotive::Steam::Middlewares::UrlRedirection
- Inherits:
-
ThreadSafe
- Object
- ThreadSafe
- Locomotive::Steam::Middlewares::UrlRedirection
- Includes:
- Helpers
- Defined in:
- lib/locomotive/steam/middlewares/url_redirection.rb
Overview
If an old URL has been found among the site url_redirections hash, perform a 310 redirection to the new URL. It is highly useful when the site existed before but was ran by another system.
See the specs (spec/unit/middlewares/url_redirection_spec.rb) for more details.
Instance Attribute Summary
Attributes inherited from ThreadSafe
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
Instance Method Details
#_call ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/locomotive/steam/middlewares/url_redirection.rb', line 14 def _call if url = redirect_url emit_event redirect_to url end end |