Class: Admin::AlbumsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::AlbumsController
- Defined in:
- app/controllers/gallery/admin/albums_controller.rb
Instance Method Summary collapse
- #fetch_albums ⇒ Object
- #fetch_photos ⇒ Object
- #set_private ⇒ Object
- #set_public ⇒ Object
- #show ⇒ Object
Instance Method Details
#fetch_albums ⇒ Object
8 9 10 11 |
# File 'app/controllers/gallery/admin/albums_controller.rb', line 8 def fetch_albums Identity.all.each(&:fetch_albums) redirect_to :back, :notice => "Albums fetched" end |
#fetch_photos ⇒ Object
25 26 27 28 29 |
# File 'app/controllers/gallery/admin/albums_controller.rb', line 25 def fetch_photos album = Album.find(params[:album_id]) album.fetch_photos redirect_to :back, :notice => "Photos fetched" end |
#set_private ⇒ Object
19 20 21 22 23 |
# File 'app/controllers/gallery/admin/albums_controller.rb', line 19 def set_private album = Album.find(params[:album_id]) album.update_attributes(:public => false) redirect_to :back, :notice => "Album #{album.name} set private" end |
#set_public ⇒ Object
13 14 15 16 17 |
# File 'app/controllers/gallery/admin/albums_controller.rb', line 13 def set_public album = Album.find(params[:album_id]) album.update_attributes(:public => true) redirect_to :back, :notice => "Album #{album.name} set public" end |
#show ⇒ Object
31 32 33 |
# File 'app/controllers/gallery/admin/albums_controller.rb', line 31 def show @album = Album.find(params[:id]) end |