Sha256: 83360f0579da634e1d6b38cbd4f52d1bd7288a21046e3dd8aa47e6c316a7c916

Contents?: true

Size: 745 Bytes

Versions: 20

Compression:

Stored size: 745 Bytes

Contents

module Administrador
  module EngineRoutable
    # This prevents missing method error when using localized
    # engines. The localized gem fails to create a default route
    # name for engines without a locale suffix. For example if you
    # have an engine named blorgh, the router should be named blorgh.
    # With localized you get blorgh_en, blorgh_de and so on. This concern
    # provides the router method without the locale as suffix.
    module LocalizedConcern
      def method_missing(m, *args, &block)
        method_name_with_locale = "#{m}_#{I18n.locale}"

        if respond_to?(method_name_with_locale)
          send(method_name_with_locale, *args, &block)
        else
          super
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
administrador-0.0.32.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.31.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.30.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.29.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.28.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.27.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.26.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.25.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.24.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.22.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.21.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.20.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.18.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.17.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.16.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.15.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.14.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.13.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.12.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.11.pre app/concerns/administrador/engine_routable/localized_concern.rb