Class: Dust::Gallery::PhotosController

Inherits:
AuthenticationController show all
Defined in:
app/controllers/dust/gallery/photos_controller.rb

Instance Method Summary collapse

Methods inherited from AuthenticationController

#not_authenticated, #permission_denied, #try_return_to_previous_page

Instance Method Details

#destroyObject



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

#editObject



13
14
15
# File 'app/controllers/dust/gallery/photos_controller.rb', line 13

def edit
  @photo = Dust::Gallery::Photo.find params[:id]
end

#showObject



9
10
11
# File 'app/controllers/dust/gallery/photos_controller.rb', line 9

def show
  @photo = Dust::Gallery::Photo.find params[:id]
end

#updateObject

end



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