Class: CarrierwaveGallery::Admin::GalleryController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- CarrierwaveGallery::Admin::GalleryController
- Defined in:
- app/controllers/carrierwave_gallery/admin/gallery_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
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/controllers/carrierwave_gallery/admin/gallery_controller.rb', line 15 def create @gallery = Gallery.new(gallery_params) respond_to do |format| if @gallery.save format.html { redirect_to admin_gallery_path(@gallery), notice: 'Gallery was successfully created.' } format.json { render :show, status: :created, location: @gallery } else format.html { render :new } format.json { render json: @gallery.errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
44 45 46 47 48 49 50 |
# File 'app/controllers/carrierwave_gallery/admin/gallery_controller.rb', line 44 def destroy @gallery.destroy respond_to do |format| format.html { redirect_to admin_gallery_index_path, notice: 'Gallery was successfully destroyed.' } format.json { head :no_content } end end |
#edit ⇒ Object
29 30 |
# File 'app/controllers/carrierwave_gallery/admin/gallery_controller.rb', line 29 def edit end |
#index ⇒ Object
4 5 6 |
# File 'app/controllers/carrierwave_gallery/admin/gallery_controller.rb', line 4 def index @collection = Gallery.all end |
#new ⇒ Object
11 12 13 |
# File 'app/controllers/carrierwave_gallery/admin/gallery_controller.rb', line 11 def new @gallery = Gallery.new end |
#show ⇒ Object
8 9 |
# File 'app/controllers/carrierwave_gallery/admin/gallery_controller.rb', line 8 def show end |
#update ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'app/controllers/carrierwave_gallery/admin/gallery_controller.rb', line 32 def update respond_to do |format| if @gallery.update(gallery_params) format.html { redirect_to admin_gallery_path(@gallery), notice: 'Gallery was successfully updated.' } format.json { render :show, status: :ok, location: @gallery } else format.html { render :edit } format.json { render json: @gallery.errors, status: :unprocessable_entity } end end end |