Class: Sibu::ImagesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Sibu::ImagesController
- Defined in:
- app/controllers/sibu/images_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/sibu/images_controller.rb', line 16 def create @image = Sibu::Image.new(image_params) if @image.save redirect_to (params[:page_id].blank? ? site_images_url(@image.site_id) : site_page_edit_content_path(@site.id, params[:page_id])), notice: "L'image a bien été téléchargée." else flash.now[:alert] = "Une erreur s'est produite lors du téléchargement de l'image." render :new end end |
#destroy ⇒ Object
35 36 |
# File 'app/controllers/sibu/images_controller.rb', line 35 def destroy end |
#edit ⇒ Object
29 30 |
# File 'app/controllers/sibu/images_controller.rb', line 29 def edit end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/sibu/images_controller.rb', line 7 def index @images = Sibu::Image.where(site_id: params[:site_id]) end |
#new ⇒ Object
11 12 13 14 |
# File 'app/controllers/sibu/images_controller.rb', line 11 def new @image = Sibu::Image.new(site_id: @site.id) @page_id = params[:page_id] end |
#show ⇒ Object
26 27 |
# File 'app/controllers/sibu/images_controller.rb', line 26 def show end |
#update ⇒ Object
32 33 |
# File 'app/controllers/sibu/images_controller.rb', line 32 def update end |