Class: Dust::Gallery::PhotosController
Instance Method Summary
collapse
#not_authenticated, #permission_denied, #try_return_to_previous_page
Instance Method Details
#destroy ⇒ Object
38
39
40
41
42
43
|
# File 'app/controllers/dust/gallery/photos_controller.rb', line 38
def destroy
@photo = Photo.find(params[:id])
@photo.destroy
redirect_to edit_dust_gallery_album_path(@photo.album)
end
|
#edit ⇒ Object
13
14
15
|
# File 'app/controllers/dust/gallery/photos_controller.rb', line 13
def edit
@photo = Dust::Gallery::Photo.find params[:id]
end
|
#show ⇒ Object
9
10
11
|
# File 'app/controllers/dust/gallery/photos_controller.rb', line 9
def show
@photo = Dust::Gallery::Photo.find params[:id]
end
|
#update ⇒ Object
28
29
30
31
32
33
34
35
36
|
# File 'app/controllers/dust/gallery/photos_controller.rb', line 28
def update
@photo = Photo.find(params[:id])
if @photo.update_attributes(params[:dust_gallery_photo])
redirect_to edit_dust_gallery_album_path(@photo.album), notice: 'Photo was successfully updated.'
else
render action: "edit"
end
end
|