Class: Admin::PhotoAlbumsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::PhotoAlbumsController
- Defined in:
- app/controllers/admin/photo_albums_controller.rb
Instance Method Summary collapse
- #album ⇒ Object
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#album ⇒ Object
45 46 47 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 45 def album @photo_album = SpudPhotoAlbum.find(params[:id]) end |
#create ⇒ Object
21 22 23 24 25 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 21 def create @photo_album = SpudPhotoAlbum.new(photo_album_params) write_photo_order if @photo_album.save respond_with @photo_album, location: admin_photo_albums_path end |
#destroy ⇒ Object
40 41 42 43 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 40 def destroy flash.now[:notice] = 'Album deleted successfully' if @photo_album.destroy respond_with @photo_album, location: admin_photo_albums_path end |
#edit ⇒ Object
27 28 29 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 27 def edit respond_with @photo_album end |
#index ⇒ Object
7 8 9 10 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 7 def index @photo_albums = SpudPhotoAlbum.all respond_with @photo_albums end |
#new ⇒ Object
16 17 18 19 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 16 def new @photo_album = SpudPhotoAlbum.new respond_with @photo_album end |
#show ⇒ Object
12 13 14 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 12 def show respond_with @photo_album end |
#update ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 31 def update @photo_album.update_attributes(photo_album_params) if @photo_album.save write_photo_order flash[:notice] = 'Album updated successfully' end respond_with @photo_album, location: admin_photo_albums_path end |