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
23 24 25 26 27 |
# File 'app/controllers/admin/photo_galleries_controller.rb', line 23 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
39 40 41 42 |
# File 'app/controllers/admin/photo_galleries_controller.rb', line 39 def destroy flash.now[:notice] = 'Gallery deleted successfully' if @photo_gallery.destroy respond_with @photo_gallery, :location => admin_photo_galleries_path end |
#edit ⇒ Object
29 30 31 |
# File 'app/controllers/admin/photo_galleries_controller.rb', line 29 def edit respond_with @photo_gallery end |
#index ⇒ Object
9 10 11 12 |
# File 'app/controllers/admin/photo_galleries_controller.rb', line 9 def index @photo_galleries = SpudPhotoGallery.all respond_with @photo_galleries end |
#new ⇒ Object
18 19 20 21 |
# File 'app/controllers/admin/photo_galleries_controller.rb', line 18 def new @photo_gallery = SpudPhotoGallery.new respond_with @photo_gallery end |
#show ⇒ Object
14 15 16 |
# File 'app/controllers/admin/photo_galleries_controller.rb', line 14 def show respond_with @photo_gallery end |
#update ⇒ Object
33 34 35 36 37 |
# File 'app/controllers/admin/photo_galleries_controller.rb', line 33 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 |