Class: Trestle::Configuration
- Inherits:
-
Object
- Object
- Trestle::Configuration
- Includes:
- Configurable
- Defined in:
- lib/trestle/configuration.rb
Defined Under Namespace
Classes: Action
Instance Method Summary collapse
-
#after_action(options = {}, &block) ⇒ Object
Register a global after action.
-
#around_action(options = {}, &block) ⇒ Object
Register a global around action.
-
#before_action(options = {}, &block) ⇒ Object
Register a global before action.
-
#form_field(name, klass) ⇒ Object
Register a custom form field class.
-
#helper(*helpers, &block) ⇒ Object
Register global helpers available to all Trestle admins.
-
#hook(name, options = {}, &block) ⇒ Object
Register an extension hook.
-
#menu(&block) ⇒ Object
Register a global navigation menu block.
Methods included from Configurable
#as_json, #assign, #configure, #fetch, #inspect, #options
Instance Method Details
#after_action(options = {}, &block) ⇒ Object
Register a global after action
134 135 136 |
# File 'lib/trestle/configuration.rb', line 134 def after_action(={}, &block) after_actions << Action.new(, block) end |
#around_action(options = {}, &block) ⇒ Object
Register a global around action
142 143 144 |
# File 'lib/trestle/configuration.rb', line 142 def around_action(={}, &block) around_actions << Action.new(, block) end |
#before_action(options = {}, &block) ⇒ Object
Register a global before action
126 127 128 |
# File 'lib/trestle/configuration.rb', line 126 def before_action(={}, &block) before_actions << Action.new(, block) end |
#form_field(name, klass) ⇒ Object
Register a custom form field class
85 86 87 |
# File 'lib/trestle/configuration.rb', line 85 def form_field(name, klass) Form::Builder.register(name, klass) end |
#helper(*helpers, &block) ⇒ Object
Register global helpers available to all Trestle admins
67 68 69 70 |
# File 'lib/trestle/configuration.rb', line 67 def helper(*helpers, &block) self.helpers += helpers self.helper_module.module_eval(&block) if block_given? end |
#hook(name, options = {}, &block) ⇒ Object
Register an extension hook
93 94 95 |
# File 'lib/trestle/configuration.rb', line 93 def hook(name, ={}, &block) hooks.append(name, , &block) end |
#menu(&block) ⇒ Object
Register a global navigation menu block
53 54 55 |
# File 'lib/trestle/configuration.rb', line 53 def (&block) << Navigation::Block.new(&block) end |