Class: Locomotive::Steam::Middlewares::LocaleRedirection

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

Overview

Redirect to the same page with or without the locale in the url based on the “prefix_default_locale” property of the current site.

See the specs (spec/unit/middlewares/locale_redirection_spec.rb) for more details.

Instance Attribute Summary

Attributes inherited from ThreadSafe

#env

Instance Method Summary collapse

Methods included from Helpers

#html?, #json?, #log, #make_local_path, #modify_path, #mounted_on, #redirect_to, #render_response

Methods inherited from ThreadSafe

#call, #default_locale, #liquid_assigns, #live_editing?, #locale, #next, #page, #params, #path, #request, #services, #site

Instance Method Details

#_callObject



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

def _call
  if url = redirect_url
    redirect_to url
  end
end