Module: Vedeu::Controller::ClassMethods
- Defined in:
- lib/vedeu/application/controller.rb
Overview
When included, provide these methods as class methods.
Instance Attribute Summary collapse
-
#controller_name ⇒ Object
writeonly
Sets the attribute controller_name.
Instance Method Summary collapse
-
#action(*action_names) ⇒ Array<Symbol>
(also: #action_name, #actions)
Specifying the action names in your controller provides Vedeu with the means to route requests to different parts of your application.
-
#controller(controller_name = nil) ⇒ Object
(also: #controller_name)
Specifying the controller name in your controller provides Vedeu with the means to route requests to different parts of your application.
Instance Attribute Details
#controller_name=(value) ⇒ Object (writeonly)
Sets the attribute controller_name
11 12 13 |
# File 'lib/vedeu/application/controller.rb', line 11 def controller_name=(value) @controller_name = value end |
Instance Method Details
#action(*action_names) ⇒ Array<Symbol> Also known as: action_name, actions
Specifying the action names in your controller provides Vedeu with the means to route requests to different parts of your application.
66 67 68 69 70 |
# File 'lib/vedeu/application/controller.rb', line 66 def action(*action_names) action_names.each do |action_name| Vedeu::Runtime::Router.add_action(@controller_name, action_name) end end |
#controller(controller_name = nil) ⇒ Object Also known as: controller_name
Specifying the controller name in your controller provides Vedeu with the means to route requests to different parts of your application.
31 32 33 34 35 36 |
# File 'lib/vedeu/application/controller.rb', line 31 def controller(controller_name = nil) @controller_name = controller_name Vedeu::Runtime::Router.add_controller(controller_name, ancestors[0].to_s) end |