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
13 14 15 |
# File 'lib/vedeu/application/controller.rb', line 13 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.
68 69 70 71 72 |
# File 'lib/vedeu/application/controller.rb', line 68 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.
33 34 35 36 37 38 |
# File 'lib/vedeu/application/controller.rb', line 33 def controller(controller_name = nil) @controller_name = controller_name Vedeu::Runtime::Router.add_controller(controller_name, ancestors[0].to_s) end |