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

Instance Method Details

#path(namespace: nil, **options) ⇒ Object



7
8
9
# File 'app/decorators/para/component/base_decorator.rb', line 7

def path(namespace: nil, **options)
  find_path([:admin, self, namespace].compact, options)
end

#relation_path(controller_or_resource, options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'app/decorators/para/component/base_decorator.rb', line 11

def relation_path(controller_or_resource, options = {})
  if Hash === controller_or_resource
    options = controller_or_resource
    controller_or_resource = nil
  end

  components = [:admin, self, controller_or_resource].compact
  find_path(components, options)
end