Module: CafeCar::Controller
- Extended by:
- ActiveSupport::Concern
- Includes:
- Authentication, Filtering, Pundit::Authorization
- Included in:
- ApplicationController, ExamplesController, SessionsController
- Defined in:
- lib/cafe_car/controller.rb
Defined Under Namespace
Modules: Filtering
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #respond_with(*resources, **options, &block) ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
89 90 91 92 |
# File 'lib/cafe_car/controller.rb', line 89 def create run_callbacks(:create) { object.save! } respond_with object end |
#destroy ⇒ Object
99 100 101 102 |
# File 'lib/cafe_car/controller.rb', line 99 def destroy run_callbacks(:destroy) { object.destroy! } respond_with object end |
#edit ⇒ Object
87 |
# File 'lib/cafe_car/controller.rb', line 87 def edit = respond_with object |
#index ⇒ Object
84 |
# File 'lib/cafe_car/controller.rb', line 84 def index = respond_with objects |
#new ⇒ Object
86 |
# File 'lib/cafe_car/controller.rb', line 86 def new = respond_with object |
#respond_with(*resources, **options, &block) ⇒ Object
104 105 106 |
# File 'lib/cafe_car/controller.rb', line 104 def respond_with(*resources, **, &block) super(*namespace, *resources, **, &block) end |
#show ⇒ Object
85 |
# File 'lib/cafe_car/controller.rb', line 85 def show = respond_with object |
#update ⇒ Object
94 95 96 97 |
# File 'lib/cafe_car/controller.rb', line 94 def update run_callbacks(:update) { object.save! } respond_with object end |