Class: Arpa::ResourcesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Arpa::ResourcesController
- Defined in:
- lib/generators/arpa/templates/controllers/resources_controller.rb
Instance Method Summary collapse
-
#generate_resources_and_actions ⇒ Object
GET /generate_resources_and_actions.
-
#index ⇒ Object
GET /resources.
-
#show ⇒ Object
GET /resources/1.
Instance Method Details
#generate_resources_and_actions ⇒ Object
GET /generate_resources_and_actions
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/generators/arpa/templates/controllers/resources_controller.rb', line 14 def generate_resources_and_actions Rails.application.eager_load! resource_params = { resourceables: ApplicationController.descendants, except_action_methods: ApplicationController.action_methods } resource_creator.create(resource_params, success: success_callback, fail: fail_callback) redirect_to resources_path end |
#index ⇒ Object
GET /resources
6 7 8 |
# File 'lib/generators/arpa/templates/controllers/resources_controller.rb', line 6 def index @resources = resource_finder.all end |
#show ⇒ Object
GET /resources/1
11 |
# File 'lib/generators/arpa/templates/controllers/resources_controller.rb', line 11 def show; end |