Module: Motr::Controller::CargoHelpers::ClassMethods
- Defined in:
- lib/motr/controller/cargo_helpers.rb
Instance Method Summary collapse
-
#delivers_cargo ⇒ Object
Normally you would have your controllers extend Motr::CargoController, in the event this isn’t possible, calling delivers_cargo will ensure the proper functionality exists.
-
#delivers_cargo_for(*resources) ⇒ Object
Configures models a particular controller “delivers”.
Instance Method Details
#delivers_cargo ⇒ Object
Normally you would have your controllers extend Motr::CargoController, in the event this isn’t possible, calling delivers_cargo will ensure the proper functionality exists.
36 37 38 |
# File 'lib/motr/controller/cargo_helpers.rb', line 36 def delivers_cargo include Motr::Cargo::Delivery end |
#delivers_cargo_for(*resources) ⇒ Object
Configures models a particular controller “delivers”. By default cargo considers the controller name to be the resource name that it is to serve. Calling delivers_cargo_for allows the controller to find objects based on object_id parameters.
26 27 28 29 |
# File 'lib/motr/controller/cargo_helpers.rb', line 26 def delivers_cargo_for(*resources) = resources. self.motr_cargo_classes |= resources end |