Class: Droom::EventsController
- Inherits:
-
EngineController
- Object
- ApplicationController
- EngineController
- Droom::EventsController
- Defined in:
- app/controllers/droom/events_controller.rb
Instance Method Summary collapse
- #calendar ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Methods inherited from EngineController
Instance Method Details
#calendar ⇒ Object
21 22 23 |
# File 'app/controllers/droom/events_controller.rb', line 21 def calendar respond_with @events end |
#create ⇒ Object
37 38 39 40 41 42 43 |
# File 'app/controllers/droom/events_controller.rb', line 37 def create if @event.save render :partial => "event" else respond_with @event end end |
#destroy ⇒ Object
53 54 55 56 |
# File 'app/controllers/droom/events_controller.rb', line 53 def destroy @event.destroy head :ok end |
#index ⇒ Object
15 16 17 18 19 |
# File 'app/controllers/droom/events_controller.rb', line 15 def index respond_with @events do |format| format.js { render :partial => 'droom/events/events' } end end |
#new ⇒ Object
32 33 34 35 |
# File 'app/controllers/droom/events_controller.rb', line 32 def new @event.start = Time.zone.now.change(hour: 10) respond_with @event end |
#show ⇒ Object
25 26 27 28 29 30 |
# File 'app/controllers/droom/events_controller.rb', line 25 def show respond_with @event do |format| format.js { render :partial => 'droom/events/event' } format.zip { send_file @event.documents_zipped.path, :type => 'application/zip', :disposition => 'attachment', :filename => "#{@event.slug}.zip" } end end |
#update ⇒ Object
45 46 47 48 49 50 51 |
# File 'app/controllers/droom/events_controller.rb', line 45 def update if @event.update_attributes(event_params) render :partial => "event" else respond_with @event end end |