Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails. Simple form multipart file not working

I use simple_form and multipart uploading does not work(uploading a single file works). Rails file_field_tag work...
Rails 3.2.13

<%= simple_form_for @building, input_html: {multipart: true} do |f| %>
...

  <%= f.simple_fields_for :paintings do |p| %>
    <%= p.input :image, as: :file %>
  <% end %>

<% end %>
like image 659
user1309082 Avatar asked May 07 '13 08:05

user1309082


1 Answers

You should use html option instead of input_html:

<%= simple_form_for @building, html: {multipart: true} do |f| %>

like image 155
Vasiliy Ermolovich Avatar answered Sep 20 '22 06:09

Vasiliy Ermolovich