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, &block) ⇒ Object
Register an extension hook.
-
#menu(&block) ⇒ Object
Register a global navigation menu block.
Methods included from Configurable
#configure, #initialize, #inspect, #options
Instance Method Details
#after_action(options = {}, &block) ⇒ Object
Register a global after action
105 106 107 |
# File 'lib/trestle/configuration.rb', line 105 def after_action(={}, &block) after_actions << Action.new(, block) end |
#around_action(options = {}, &block) ⇒ Object
Register a global around action
113 114 115 |
# File 'lib/trestle/configuration.rb', line 113 def around_action(={}, &block) around_actions << Action.new(, block) end |
#before_action(options = {}, &block) ⇒ Object
Register a global before action
97 98 99 |
# File 'lib/trestle/configuration.rb', line 97 def before_action(={}, &block) before_actions << Action.new(, block) end |
#form_field(name, klass) ⇒ Object
Register a custom form field class
73 74 75 |
# File 'lib/trestle/configuration.rb', line 73 def form_field(name, klass) Form::Builder.register(name, klass) end |
#helper(*helpers, &block) ⇒ Object
Register global helpers available to all Trestle admins
55 56 57 58 |
# File 'lib/trestle/configuration.rb', line 55 def helper(*helpers, &block) self.helpers += helpers self.helper_module.module_eval(&block) if block_given? end |
#hook(name, &block) ⇒ Object
Register an extension hook
81 82 83 |
# File 'lib/trestle/configuration.rb', line 81 def hook(name, &block) hooks[name.to_s] << block end |
#menu(&block) ⇒ Object
Register a global navigation menu block
41 42 43 |
# File 'lib/trestle/configuration.rb', line 41 def (&block) << Navigation::Block.new(&block) end |