Hi
I'm trying to get Neo4j-paperclip working and I'm getting an error in sinatra (Padrino).
I'm getting the following error
No handler found for {"tempfile"=>#<Tempfile:/var/folders/sf/fjy566gx75xc6zwypk7hpj8d5st7rm/T/RackMultipart20141117-9072-w8mddq>, "filename"=>"IMG_7677.JPG", "content_type"=>"image/jpeg", "size"=>400768}
Here is my model file
class Image
include Neo4j::ActiveNode
include Neo4jrb::Paperclip
id_property :db_id, auto: :uuid
has_neo4jrb_attached_file :base_image, :url => "/images/:class/:attachment/:id/:style_:filename", :keep_old_files => true,:path => "/Code/public/images/raw/:class/:attachment/:id_partition/:style/:filename"
validates_attachment_content_type :base_image, content_type: ["image/jpg", "image/jpeg", "image/png", "image/gif","image/webp"]
property :created_at
property :updated_at
end
####### Controller
post :upload_photo, :map => "/photo/", :csrf_protection => false do
paperclip = {}
paperclip['tempfile'] = params[:file][:tempfile]
paperclip['filename'] = params[:file][:filename]
paperclip['content_type'] = params[:file][:type]
paperclip['size'] = params[:file][:tempfile].size
image = Image.new(:base_image => paperclip )
halt "There were some errors processing your request..." unless image.save
end
#### view
<form action="/web/restaurants/photo" method="POST" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit" value="Upload image">
</form>
Googling shows there is something wrong with the object names. Can anyone share an example of neo4j-paperclip ?
Thanks
John