DG IZ photo uploading now works
This commit is contained in:
parent
aa2ea3f300
commit
4fe4326ed1
1 changed files with 13 additions and 7 deletions
|
|
@ -12,6 +12,7 @@ class PhotosController < ApplicationController
|
|||
def create
|
||||
|
||||
album = Album.find_by_id params[:album_id]
|
||||
puts params
|
||||
|
||||
begin
|
||||
|
||||
|
|
@ -102,13 +103,18 @@ class PhotosController < ApplicationController
|
|||
|
||||
private
|
||||
def clean_hash(params)
|
||||
return {
|
||||
:photo => {
|
||||
:caption => params[:photo][:caption],
|
||||
},
|
||||
:album_id => params[:album_id],
|
||||
:user_file => params[:user_file]
|
||||
}
|
||||
if params[:photo]
|
||||
return {
|
||||
:photo => {
|
||||
:caption => params[:photo][:caption],
|
||||
}
|
||||
}
|
||||
else
|
||||
return{
|
||||
:album_id => params[:album_id],
|
||||
:user_file => params[:user_file]
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue