Class: Dust::Gallery::AlbumsController
Instance Method Summary
collapse
#not_authenticated, #permission_denied, #try_return_to_previous_page
Instance Method Details
#create ⇒ Object
21
22
23
24
25
26
27
28
29
|
# File 'app/controllers/dust/gallery/albums_controller.rb', line 21
def create
@album = Dust::Gallery::Album.(params[:dust_gallery_album])
if @album.save
redirect_to edit_dust_gallery_album_path(@album), notice: 'Album was successfully created.'
else
render action: "new"
end
end
|
#destroy ⇒ Object
41
42
43
44
45
46
|
# File 'app/controllers/dust/gallery/albums_controller.rb', line 41
def destroy
@album = Dust::Gallery::Album.find(params[:id])
@album.destroy
redirect_to dust_gallery_albums_url
end
|
#edit ⇒ Object
17
18
19
|
# File 'app/controllers/dust/gallery/albums_controller.rb', line 17
def edit
@album = Dust::Gallery::Album.find(params[:id])
end
|
#index ⇒ Object
9
10
11
|
# File 'app/controllers/dust/gallery/albums_controller.rb', line 9
def index
@albums = Dust::Gallery::Album.all
end
|
#new ⇒ Object
13
14
15
|
# File 'app/controllers/dust/gallery/albums_controller.rb', line 13
def new
@album = Dust::Gallery::Album.
end
|
#update ⇒ Object
31
32
33
34
35
36
37
38
39
|
# File 'app/controllers/dust/gallery/albums_controller.rb', line 31
def update
@album = Dust::Gallery::Album.find(params[:id])
if @album.update_attributes(params[:dust_gallery_album])
redirect_to dust_gallery_albums_path, notice: 'Album was successfully updated.'
else
render action: "edit"
end
end
|