Module: Para::Component::BaseDecorator
- Includes:
- ActionDispatch::Routing::PolymorphicRoutes
- Included in:
- CrudDecorator, FormDecorator, SettingsDecorator
- Defined in:
- app/decorators/para/component/base_decorator.rb
Instance Method Summary collapse
- #page_container_class ⇒ Object
- #path(namespace: nil, **options) ⇒ Object
- #relation_path(controller_or_resource, *nested_resources, **options) ⇒ Object
Instance Method Details
#page_container_class ⇒ Object
27 28 29 |
# File 'app/decorators/para/component/base_decorator.rb', line 27 def page_container_class 'col-xs-12' end |
#path(namespace: nil, **options) ⇒ Object
7 8 9 |
# File 'app/decorators/para/component/base_decorator.rb', line 7 def path(namespace: nil, **) find_path([:admin, self, namespace].compact, ) end |
#relation_path(controller_or_resource, *nested_resources, **options) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/decorators/para/component/base_decorator.rb', line 11 def relation_path(controller_or_resource, *nested_resources, **) nested = nested_resources.any? if controller_or_resource.is_a?(Hash) = controller_or_resource controller_or_resource = nil end controller_or_resource = nil if controller_or_resource.is_a?(ActiveRecord::Base) [:action] = action_option_for(, nested: nested) components = [:admin, self, controller_or_resource, *nested_resources].compact find_path(components, ) end |