Module: Para::Component::FormDecorator
- Includes:
- BaseDecorator
- Defined in:
- app/decorators/para/component/form_decorator.rb
Instance Method Summary collapse
- #action_option_for(options, nested: false) ⇒ Object
- #path(namespace: :resource, **options) ⇒ Object
- #relation_path(controller_or_resource, *nested_resources, **options) ⇒ Object
Instance Method Details
#action_option_for(options, nested: false) ⇒ Object
23 24 25 26 27 28 29 |
# File 'app/decorators/para/component/form_decorator.rb', line 23 def action_option_for(, nested: false) if !nested && [:action].try(:to_sym) == :show nil else [:action] end end |
#path(namespace: :resource, **options) ⇒ Object
6 7 8 |
# File 'app/decorators/para/component/form_decorator.rb', line 6 def path(namespace: :resource, **) find_path([:admin, self, namespace], ) end |
#relation_path(controller_or_resource, *nested_resources, **options) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/decorators/para/component/form_decorator.rb', line 10 def relation_path(controller_or_resource, *nested_resources, **) nested = nested_resources.any? if Hash === controller_or_resource = controller_or_resource end [:action] = action_option_for(, nested: nested) data = [:admin, self, :resource, *nested_resources] find_path(data, ) end |