Class: ChiliPepper::DishesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- ChiliPepper::DishesController
- Defined in:
- app/controllers/chili_pepper/dishes_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/controllers/chili_pepper/dishes_controller.rb', line 16 def create @dish = Dish.new(dish_params) if @dish.save! else render action: :new end end |
#destroy ⇒ Object
36 37 38 39 |
# File 'app/controllers/chili_pepper/dishes_controller.rb', line 36 def destroy @dish.destroy end |
#edit ⇒ Object
25 26 |
# File 'app/controllers/chili_pepper/dishes_controller.rb', line 25 def edit end |
#new ⇒ Object
11 12 13 14 |
# File 'app/controllers/chili_pepper/dishes_controller.rb', line 11 def new @dish = Dish.new @item = build_item end |
#update ⇒ Object
28 29 30 31 32 33 34 |
# File 'app/controllers/chili_pepper/dishes_controller.rb', line 28 def update if @dish.update(dish_params) else render action: :edit end end |