Sha256: eaf7befaaf54a165b526e0ec7ab0ec5711f53d9126e10e49d5d5cc0a42d72797

Contents?: true

Size: 746 Bytes

Versions: 10

Compression:

Stored size: 746 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 enginges without a locale soffix. 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

10 entries across 10 versions & 1 rubygems

Version Path
administrador-0.0.10.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.9.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.8.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.7.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.6.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.5.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.4.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.3.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.2.pre app/concerns/administrador/engine_routable/localized_concern.rb
administrador-0.0.1.pre app/concerns/administrador/engine_routable/localized_concern.rb