Class: Droom::Api::EventsController
- Inherits:
-
ApiController
- Object
- ApplicationController
- EngineController
- ApiController
- Droom::Api::EventsController
- Defined in:
- app/controllers/droom/api/events_controller.rb
Instance Method Summary collapse
Methods inherited from ApiController
Methods inherited from EngineController
Instance Method Details
#create ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/droom/api/events_controller.rb', line 21 def create if @event && @event.persisted? render json: @event else render json: { errors: @event.errors.to_a } end end |
#destroy ⇒ Object
31 32 33 34 |
# File 'app/controllers/droom/api/events_controller.rb', line 31 def destroy @event.destroy head :ok end |
#index ⇒ Object
8 9 10 |
# File 'app/controllers/droom/api/events_controller.rb', line 8 def index render json: @events end |
#show ⇒ Object
12 13 14 |
# File 'app/controllers/droom/api/events_controller.rb', line 12 def show render json: @event end |
#update ⇒ Object
16 17 18 19 |
# File 'app/controllers/droom/api/events_controller.rb', line 16 def update @event.update_attributes(event_params) render json: @event end |