Sha256: a6557babd183a69c630bf651bb00e6468942260ece91ea10ef70f862b08b7b57
Contents?: true
Size: 691 Bytes
Versions: 124
Compression:
Stored size: 691 Bytes
Contents
# -*- encoding : utf-8 -*- class InlineFormsApplicationController < ActionController::Base protect_from_forgery layout 'devise' if :devise_controller? # limit available locales by setting this. Override in applicaton_controller. I18n.available_locales = [ :en, :nl, :pp ] #set the locale based on the subdomain def set_locale I18n.locale = extract_locale_from_subdomain || I18n.default_locale end # Get locale code from request subdomain (like http://it.application.local:3000) def extract_locale_from_subdomain locale = request.subdomains.first return nil if locale.nil? I18n.available_locales.include?(locale.to_sym) ? locale.to_s : nil end end
Version data entries
124 entries across 124 versions & 1 rubygems