Class: Admix::PhotosController

Inherits:
AdmixController
  • Object
show all
Defined in:
app/controllers/admix/photos_controller.rb

Instance Method Summary collapse

Instance Method Details

#image_paramObject



27
28
29
30
31
# File 'app/controllers/admix/photos_controller.rb', line 27

def image_param
  if params[:image]
    params[:photo] = { image: params[:image] }
  end
end

#update_descriptionObject

TODO: Maybe we need to skip authorization here. But not authetication.



14
15
16
17
18
19
20
# File 'app/controllers/admix/photos_controller.rb', line 14

def update_description
  @album = Album.find(params[:album_id])
  @photo = @album.photos.find(params[:id])
  @photo.description = params[:description]
  @photo.save()
  render :json => @photo
end

#uploadObject



23
24
25
# File 'app/controllers/admix/photos_controller.rb', line 23

def upload
  render inline: params.to_s
end