Class: Admin::AlbumsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/gallery/admin/albums_controller.rb

Instance Method Summary collapse

Instance Method Details

#fetch_albumsObject



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_photosObject



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_privateObject



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_publicObject



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

#showObject



31
32
33
# File 'app/controllers/gallery/admin/albums_controller.rb', line 31

def show
  @album = Album.find(params[:id])
end