Sha256: c0e00e8f7acb9fff0cc3896b7bca672f3ed3b40403fd454f6ac313b154911428

Contents?: true

Size: 832 Bytes

Versions: 6

Compression:

Stored size: 832 Bytes

Contents

module ActionDispatch::Routing
  class Mapper
    def globalize_hierarchical_resource(scope,locales,options = {})
      mount Mercury::Engine => options[:mercury] || "/" if options[:mercury] != false
      if Amalgam.i18n == 'param'
        scope "(:locale)", :locale => locales do
          get "/#{scope.to_s}/*slug" => "#{scope.to_s}#show" , :as => scope.to_s.singularize.to_sym
        end
      end
      get "/#{scope.to_s}/*slug" => "#{scope.to_s}#show" , :as => scope.to_s.singularize.to_sym, :constraints => { :subdomain => locales } if Amalgam.i18n == 'subdomain'
    end

    def hierarchical_resource(scope,options = {})
      mount Mercury::Engine => options[:mercury] || "/" if options[:mercury] != false
      get "/#{scope.to_s}/*slug" => "#{scope.to_s}#show" , :as => scope.to_s.singularize.to_sym
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
amalgam-2.1.4.1 lib/page_routes.rb
amalgam-2.1.4 lib/page_routes.rb
amalgam-2.1.3.1 lib/page_routes.rb
amalgam-2.1.3 lib/page_routes.rb
amalgam-2.1.2 lib/page_routes.rb
amalgam-2.1.1 lib/page_routes.rb