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
78 79 80 81 82 83 84 |
# File 'lib/active_scaffold/extensions/routing_mapper.rb', line 78 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
86 87 88 89 90 91 92 |
# File 'lib/active_scaffold/extensions/routing_mapper.rb', line 86 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
94 95 96 |
# File 'lib/active_scaffold/extensions/routing_mapper.rb', line 94 def parent_scaffold merge_module_scope(@scope[:module], parent_resource.plural) end |