Class: CalendarsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- CalendarsController
- Defined in:
- lib/app/controllers/calendars_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
-
#index ⇒ Object
verify :method => :post, :only => :create.
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
21 22 23 |
# File 'lib/app/controllers/calendars_controller.rb', line 21 def create respond_with(@calendar = Calendar.create(params[:calendar])) end |
#destroy ⇒ Object
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 |
#edit ⇒ Object
17 18 19 |
# File 'lib/app/controllers/calendars_controller.rb', line 17 def edit respond_with(@calendar = Calendar.find(params[:id])) end |
#index ⇒ Object
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 |
#new ⇒ Object
13 14 15 |
# File 'lib/app/controllers/calendars_controller.rb', line 13 def new respond_with(@calendar = Calendar.new) end |
#show ⇒ Object
9 10 11 |
# File 'lib/app/controllers/calendars_controller.rb', line 9 def show respond_with(@calendar = Calendar.find(params[:id])) end |
#update ⇒ Object
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 |