Class: LoyalAdmin::LoyalCore::Skin::RecipesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- LoyalAdmin::LoyalCore::Skin::RecipesController
- Defined in:
- app/controllers/loyal_admin/loyal_core/skin/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
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/loyal_admin/loyal_core/skin/recipes_controller.rb', line 18 def create @loyal_core_skin_recipe = ::LoyalCore::Skin::Recipe.new(params[:loyal_core_skin_recipe]) @loyal_core_skin_recipe.created_by = current_user.id @loyal_core_skin_recipe.created_ip = request.remote_ip if @loyal_core_skin_recipe.save redirect_to loyal_admin_app.loyal_core_skin_recipe_url(:id => @loyal_core_skin_recipe.id) else render :new end end |
#destroy ⇒ Object
45 46 47 48 49 50 51 |
# File 'app/controllers/loyal_admin/loyal_core/skin/recipes_controller.rb', line 45 def destroy @loyal_core_skin_recipe = ::LoyalCore::Skin::Recipe.find params[:id] @loyal_core_skin_recipe.destroy redirect_to params[:return_to] || loyal_admin_app.loyal_core_skin_recipes_url end |
#edit ⇒ Object
31 32 33 |
# File 'app/controllers/loyal_admin/loyal_core/skin/recipes_controller.rb', line 31 def edit @loyal_core_skin_recipe = ::LoyalCore::Skin::Recipe.find params[:id] end |
#index ⇒ Object
6 7 8 |
# File 'app/controllers/loyal_admin/loyal_core/skin/recipes_controller.rb', line 6 def index @loyal_core_skin_recipes = ::LoyalCore::Skin::Recipe.page(params[:page]) end |
#new ⇒ Object
14 15 16 |
# File 'app/controllers/loyal_admin/loyal_core/skin/recipes_controller.rb', line 14 def new @loyal_core_skin_recipe = ::LoyalCore::Skin::Recipe.new end |
#show ⇒ Object
10 11 12 |
# File 'app/controllers/loyal_admin/loyal_core/skin/recipes_controller.rb', line 10 def show @loyal_core_skin_recipe = ::LoyalCore::Skin::Recipe.find params[:id] end |
#update ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'app/controllers/loyal_admin/loyal_core/skin/recipes_controller.rb', line 35 def update @loyal_core_skin_recipe = ::LoyalCore::Skin::Recipe.find params[:id] if @loyal_core_skin_recipe.update_attributes(params[:loyal_core_skin_recipe]) redirect_to loyal_admin_app.loyal_core_skin_recipe_url(:id => @loyal_core_skin_recipe.id) else render :edit end end |