Class: ActionDispatch::Routing::Mapper
- Inherits:
-
Object
- Object
- ActionDispatch::Routing::Mapper
- Defined in:
- lib/page_routes.rb
Instance Method Summary collapse
- #globalize_hierarchical_resource(scope, locales, options = {}) ⇒ Object
- #hierarchical_resource(scope, options = {}) ⇒ Object
Instance Method Details
#globalize_hierarchical_resource(scope, locales, options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/page_routes.rb', line 3 def globalize_hierarchical_resource(scope,locales, = {}) mount Mercury::Engine => [:mercury] || "/" if [: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 |
#hierarchical_resource(scope, options = {}) ⇒ Object
13 14 15 16 |
# File 'lib/page_routes.rb', line 13 def hierarchical_resource(scope, = {}) mount Mercury::Engine => [:mercury] || "/" if [:mercury] != false get "/#{scope.to_s}/*slug" => "#{scope.to_s}#show" , :as => scope.to_s.singularize.to_sym end |