Module: ActionDispatch::Routing::Mapper::Resources
- Defined in:
- lib/active_scaffold/extensions/routing_mapper.rb
Instance Method Summary collapse
- #as_nested_resources(*resources) ⇒ Object
- #as_scoped_routes(*scopes) ⇒ Object
- #parent_scaffold ⇒ Object
Instance Method Details
#as_nested_resources(*resources) ⇒ Object
77 78 79 80 81 82 83 |
# File 'lib/active_scaffold/extensions/routing_mapper.rb', line 77 def as_nested_resources(*resources) = resources. = .merge(parent_scaffold: parent_scaffold) resources.each do |resource| resources(resource, .merge(association: resource)) { yield if block_given? } end end |
#as_scoped_routes(*scopes) ⇒ Object
85 86 87 88 89 90 91 |
# File 'lib/active_scaffold/extensions/routing_mapper.rb', line 85 def as_scoped_routes(*scopes) = scopes. = .merge(parent_scaffold: parent_scaffold, association: parent_resource.plural) scopes.each do |scope| resources(scope, .merge(named_scope: scope)) { yield if block_given? } end end |
#parent_scaffold ⇒ Object
93 94 95 |
# File 'lib/active_scaffold/extensions/routing_mapper.rb', line 93 def parent_scaffold merge_module_scope(@scope[:module], parent_resource.plural) end |