Class: Dust::Gallery::Api::PhotosController

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

Instance Method Summary collapse

Methods inherited from AuthenticationController

#not_authenticated, #permission_denied, #try_return_to_previous_page

Instance Method Details

#createObject



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

def create
  file = AppSpecificStringIO.new(params[:qqfile], request.raw_post)
  respond_with Dust::Gallery::Photo.create :filename => file, :album_id => params[:album_id]
end

#destroyObject



21
22
23
# File 'app/controllers/dust/gallery/api/photos_controller.rb', line 21

def destroy
  respond_with Dust::Gallery::Photo.destroy params[:id]
end

#showObject



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

def show
  respond_with Dust::Gallery::Photo.find(params[:id])
end

#updateObject



17
18
19
# File 'app/controllers/dust/gallery/api/photos_controller.rb', line 17

def update
  respond_with Dust::Gallery::Photo.update params[:dust_gallery_photo]
end