Class: CalendarsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/app/controllers/calendars_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



21
22
23
# File 'lib/app/controllers/calendars_controller.rb', line 21

def create
  respond_with(@calendar = Calendar.create(params[:calendar]))
end

#destroyObject



31
32
33
34
35
36
37
38
39
# File 'lib/app/controllers/calendars_controller.rb', line 31

def destroy
  @calendar = Calendar.find(params[:id])
  @calendar.destroy

  respond_to do |format|
    format.html { redirect_to(calendars_url) }
    format.xml  { head :ok }
  end
end

#editObject



17
18
19
# File 'lib/app/controllers/calendars_controller.rb', line 17

def edit
  respond_with(@calendar = Calendar.find(params[:id]))
end

#indexObject

verify :method => :post, :only => :create



5
6
7
# File 'lib/app/controllers/calendars_controller.rb', line 5

def index
  respond_with(@calendars = Calendar.all)
end

#newObject



13
14
15
# File 'lib/app/controllers/calendars_controller.rb', line 13

def new
  respond_with(@calendar = Calendar.new)
end

#showObject



9
10
11
# File 'lib/app/controllers/calendars_controller.rb', line 9

def show
  respond_with(@calendar = Calendar.find(params[:id]))
end

#updateObject



25
26
27
28
29
# File 'lib/app/controllers/calendars_controller.rb', line 25

def update
  @calendar = Calendar.find(params[:id])
  @calendar.update_attributes(params[:calendar])
  respond_with(@calendar)
end