format.js generate 406 Not Acceptable error
- by Denis
Hello,
following code generate a 406 Not Acceptable error.
What can be wrong with my code?
def remote_create
@photo = Photo.new(params[:photo])
respond_to do |format|
if @photo.save
# add @photo's thumbnail to last import tag
format.js {
render :update do |page|
page.insert_html :bottom, 'polaroids' , :partial => 'polaroid', :locals => {:photo => @photo}
end
}
else
format.html
end
end
end
Started POST "/photos/remote_create" for 127.0.0.1 at 2010-03-14 14:02:08
Processing by PhotosController#remote_create as HTML
Parameters: {"photo"=>{"photo"=>#<File:/var/folders/BT/BTpdsWBkF6myaI-sl3+1NU+++TI/-Tmp-/RackMultipart20100314-285-1y9eq1x-0>, "name"=>"4204497503_a0c43c561d.jpg"}}
SQL (0.6ms) INSERT INTO "photos" ("created_at", "filename", "height", "name", "photo_content_type", "photo_file_name", "photo_file_size", "photo_updated_at", "size", "updated_at", "width") VALUES ('2010-03-14 13:02:08.449499', NULL, NULL, '4204497503_a0c43c561d.jpg', 'application/octet-stream', '4204497503_a0c43c561d.jpg', 136710, '2010-03-14 13:02:08.446370', NULL, '2010-03-14 13:02:08.449499', NULL)
[paperclip] Saving attachments.
[paperclip] saving /Users/denisjacquemin/Documents/code/projects/photos/public/system/photos/224/original/4204497503_a0c43c561d.jpg
Completed in 101ms with 406