Module: Effective::CrudController::ClassMethods
- Includes:
- Dsl
- Defined in:
- app/controllers/concerns/effective/crud_controller.rb
Instance Method Summary collapse
-
#define_actions_from_routes ⇒ Object
Automatically respond to any action defined via the routes file.
-
#effective_resource ⇒ Object
This is used to define_actions_from_routes and for the buttons/submits/ons It doesn’t really work with the resource_scope correctly but the routes are important here.
Methods included from Dsl
#after_commit, #after_error, #after_save, #before_render, #before_save, #button, #on, #page_title, #resource_scope, #submit
Instance Method Details
#define_actions_from_routes ⇒ Object
Automatically respond to any action defined via the routes file
29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/concerns/effective/crud_controller.rb', line 29 def define_actions_from_routes (effective_resource.member_actions - effective_resource.crud_actions).each do |action| define_method(action) { member_action(action) } end (effective_resource.collection_actions - effective_resource.crud_actions).each do |action| define_method(action) { collection_action(action) } end end |
#effective_resource ⇒ Object
This is used to define_actions_from_routes and for the buttons/submits/ons It doesn’t really work with the resource_scope correctly but the routes are important here
24 25 26 |
# File 'app/controllers/concerns/effective/crud_controller.rb', line 24 def effective_resource @_effective_resource ||= Effective::Resource.new(controller_path) end |