Class: Droom::EventsController

Inherits:
EngineController show all
Defined in:
app/controllers/droom/events_controller.rb

Instance Method Summary collapse

Instance Method Details

#calendarObject



25
26
27
28
29
30
31
# File 'app/controllers/droom/events_controller.rb', line 25

def calendar
  respond_with @events do |format|
    format.js {
      render :partial => 'droom/events/calendar'
    }
  end
end

#createObject



48
49
50
51
52
53
54
# File 'app/controllers/droom/events_controller.rb', line 48

def create
  if @event.save
    render :partial => "created"
  else
    respond_with @event
  end
end

#destroyObject



69
70
71
72
# File 'app/controllers/droom/events_controller.rb', line 69

def destroy
  @event.destroy
  head :ok
end

#editObject



56
57
58
# File 'app/controllers/droom/events_controller.rb', line 56

def edit
  
end

#indexObject



17
18
19
20
21
22
23
# File 'app/controllers/droom/events_controller.rb', line 17

def index
  respond_with @events do |format|
    format.js {
      render :partial => 'droom/events/events'
    }
  end
end

#newObject



44
45
46
# File 'app/controllers/droom/events_controller.rb', line 44

def new
  respond_with @event
end

#showObject



33
34
35
36
37
38
39
40
41
42
# File 'app/controllers/droom/events_controller.rb', line 33

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

#updateObject



60
61
62
63
64
65
66
67
# File 'app/controllers/droom/events_controller.rb', line 60

def update
  @event.update_attributes(params[:event])
  if @event.save
    render :partial => "event"
  else
    respond_with @event
  end
end