Class: Admin::PhotoAlbumsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::PhotoAlbumsController
- Defined in:
- app/controllers/admin/photo_albums_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #get_album ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
22 23 24 25 26 27 28 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 22 def create @photo_album = SpudPhotoAlbum.new(photo_album_params) if @photo_album.save set_photo_order end respond_with @photo_album, :location => admin_photo_albums_path end |
#destroy ⇒ Object
43 44 45 46 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 43 def destroy flash.now[:notice] = 'Album deleted successfully' if @photo_album.destroy respond_with @photo_album, :location => admin_photo_albums_path end |
#edit ⇒ Object
30 31 32 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 30 def edit respond_with @photo_album end |
#get_album ⇒ Object
48 49 50 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 48 def get_album @photo_album = SpudPhotoAlbum.find(params[:id]) end |
#index ⇒ Object
8 9 10 11 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 8 def index @photo_albums = SpudPhotoAlbum.all respond_with @photo_albums end |
#new ⇒ Object
17 18 19 20 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 17 def new @photo_album = SpudPhotoAlbum.new respond_with @photo_album end |
#show ⇒ Object
13 14 15 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 13 def show respond_with @photo_album end |
#update ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'app/controllers/admin/photo_albums_controller.rb', line 34 def update @photo_album.update_attributes(photo_album_params) if @photo_album.save set_photo_order flash[:notice] = 'Album updated successfully' end respond_with @photo_album, :location => admin_photo_albums_path end |