Sha256: cf9b9f3e1149fe174783ef83c50857e99b2edf938c81cc7e6c5e29826b34b6a5

Contents?: true

Size: 690 Bytes

Versions: 116

Compression:

Stored size: 690 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

116 entries across 116 versions & 1 rubygems

Version Path
inline_forms-1.6.57 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.56 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.55 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.54 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.53 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.51 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.50 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.49 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.48 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.47 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.46 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.45 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.44 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.43 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.42 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.41 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.40 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.39 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.38 lib/app/controllers/inline_forms_application_controller.rb
inline_forms-1.6.37 lib/app/controllers/inline_forms_application_controller.rb