Class: Display::RecipesController
- Inherits:
-
LoyalAdmin::ApplicationController
- Object
- ActionController::Base
- LoyalAdmin::ApplicationController
- Display::RecipesController
- Defined in:
- app/controllers/loyal_admin/display/recipes_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/loyal_admin/display/recipes_controller.rb', line 16 def create @display_recipe = ::LoyalAdmin::Display::Recipe.new(params[:display_recipe]) if @display_recipe.save redirect_to loyal_admin_app.display_recipe_url(:id => @display_recipe.id) else render :new end end |
#destroy ⇒ Object
40 41 42 43 44 45 46 |
# File 'app/controllers/loyal_admin/display/recipes_controller.rb', line 40 def destroy @display_recipe = ::LoyalAdmin::Display::Recipe.find params[:id] @display_recipe.destroy redirect_to params[:return_to] || loyal_admin_app.display_recipes_url end |
#edit ⇒ Object
26 27 28 |
# File 'app/controllers/loyal_admin/display/recipes_controller.rb', line 26 def edit @display_recipe = ::LoyalAdmin::Display::Recipe.find params[:id] end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/loyal_admin/display/recipes_controller.rb', line 4 def index @display_recipes = ::LoyalAdmin::Display::Recipe.page(params[:page]).per(30) end |
#new ⇒ Object
12 13 14 |
# File 'app/controllers/loyal_admin/display/recipes_controller.rb', line 12 def new @display_recipe = ::LoyalAdmin::Display::Recipe.new end |
#show ⇒ Object
8 9 10 |
# File 'app/controllers/loyal_admin/display/recipes_controller.rb', line 8 def show @display_recipe = ::LoyalAdmin::Display::Recipe.find params[:id] end |
#update ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'app/controllers/loyal_admin/display/recipes_controller.rb', line 30 def update @display_recipe = ::LoyalAdmin::Display::Recipe.find params[:id] if @display_recipe.update_attributes(params[:display_recipe]) redirect_to loyal_admin_app.display_recipe_url(:id => @display_recipe.id) else render :edit end end |