Class: Lists::ListsController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Lists::ListsController
- Defined in:
- app/controllers/lists/lists_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
10 11 12 13 14 |
# File 'app/controllers/lists/lists_controller.rb', line 10 def create @list = List.new(params[:list]) @list.save respond_with @list end |
#destroy ⇒ Object
33 34 35 36 37 |
# File 'app/controllers/lists/lists_controller.rb', line 33 def destroy @list = List.find(params[:id]) @list.destroy respond_with @list end |
#edit ⇒ Object
21 22 23 24 25 |
# File 'app/controllers/lists/lists_controller.rb', line 21 def edit @list = List.find(params[:id]) @list.list_items.build respond_with @list end |
#new ⇒ Object
5 6 7 8 |
# File 'app/controllers/lists/lists_controller.rb', line 5 def new @list = List.new @list.list_items.build end |
#show ⇒ Object
16 17 18 19 |
# File 'app/controllers/lists/lists_controller.rb', line 16 def show @list = List.find(params[:id]) respond_with @list end |
#update ⇒ Object
27 28 29 30 31 |
# File 'app/controllers/lists/lists_controller.rb', line 27 def update @list = List.find(params[:id]) @list.update_attributes(params[:list]) respond_with @list end |