Class: Admin::PhotoGalleriesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::PhotoGalleriesController
- Defined in:
- app/controllers/admin/photo_galleries_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
22 23 24 25 26 |
# File 'app/controllers/admin/photo_galleries_controller.rb', line 22 def create @photo_gallery = SpudPhotoGallery.new(photo_gallery_params) flash[:notice] = 'Gallery created successfully' if @photo_gallery.save respond_with @photo_gallery, location: admin_photo_galleries_path end |
#destroy ⇒ Object
38 39 40 41 |
# File 'app/controllers/admin/photo_galleries_controller.rb', line 38 def destroy flash.now[:notice] = 'Gallery deleted successfully' if @photo_gallery.destroy respond_with @photo_gallery, location: admin_photo_galleries_path end |
#edit ⇒ Object
28 29 30 |
# File 'app/controllers/admin/photo_galleries_controller.rb', line 28 def edit respond_with @photo_gallery end |
#index ⇒ Object
8 9 10 11 |
# File 'app/controllers/admin/photo_galleries_controller.rb', line 8 def index @photo_galleries = SpudPhotoGallery.all respond_with @photo_galleries end |
#new ⇒ Object
17 18 19 20 |
# File 'app/controllers/admin/photo_galleries_controller.rb', line 17 def new @photo_gallery = SpudPhotoGallery.new respond_with @photo_gallery end |
#show ⇒ Object
13 14 15 |
# File 'app/controllers/admin/photo_galleries_controller.rb', line 13 def show respond_with @photo_gallery end |
#update ⇒ Object
32 33 34 35 36 |
# File 'app/controllers/admin/photo_galleries_controller.rb', line 32 def update @photo_gallery.update_attributes(photo_gallery_params) flash[:notice] = 'Gallery updated successfully' if @photo_gallery.save respond_with @photo_gallery, location: admin_photo_galleries_path end |