Class: Portfolio::Admin::SiteItemImagesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Portfolio::Admin::SiteItemImagesController
- Defined in:
- app/controllers/portfolio/admin/site_item_images_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/portfolio/admin/site_item_images_controller.rb', line 8 def create @image = SiteItemImage.new(image_params) if @image.save redirect_to edit_project_path, notice: 'Image was successfully created.' else @item = @item_project.item render template: 'portfolio/item_projects/edit' end end |
#destroy ⇒ Object
32 33 34 35 |
# File 'app/controllers/portfolio/admin/site_item_images_controller.rb', line 32 def destroy @image.destroy redirect_to edit_project_path, notice: 'Image was successfully destroyed.' end |
#set_default ⇒ Object
27 28 29 30 |
# File 'app/controllers/portfolio/admin/site_item_images_controller.rb', line 27 def set_default @image.update(default: true) redirect_to edit_project_path, notice: 'Image was successfully updated.' end |
#update ⇒ Object
19 20 21 22 23 24 25 |
# File 'app/controllers/portfolio/admin/site_item_images_controller.rb', line 19 def update if @image.update(image_params) redirect_to edit_project_path, notice: 'Image was successfully updated.' else render :edit end end |