Monday, 15 August 2011

ruby - paperclip No handler found for "file.jpg" rails 4 -


I am having trouble installing a paperclip gem in one of the applications.
I can not find a handler when I try to save the uploaded file My migration found for error message:

  add_attachment: Order, file:  

Model:

  has_attached_file: file validates_attachment_content_type: file ,: content_type = & gt; /  

Controller:

  Draf order_param parameters.Require (: order) .Permit (: file)  

:

  form_tag url, method :: post, html: {multipart: true} ... = file_field_tag ​​'order [file]', disabled: when I order my controller  If you try to execute, accept 'mtd_file': 'image / png, image / gif, image / jpeg'  

order] I get an error No handler was found for "file.jpg"

When I entered order [file] I see that this is a string file.jpg (name of uploaded file)
can you help me? What am i doing wrong

Try the code below, you do not have to pass mulitpart As html hash

  `form_tag url, method :: post, multipart: true`  
<<> form_for
You must pass multipart in html hash

  form_for (@user): HTML = & gt; {: Multipurpose = & gt; True} what? F |  

For more information, you can refer to below the docs


No comments:

Post a Comment