When uploading files without using the form helper form.file_field
, you have to add the option multipart: true
to the form tag.
Discovered in API Docs
< %= form_with(model: @company), multipart: true) do |form| %>
-- When using: --
<input type="file" name="company[logo]" />
-- OR --
< %= file_field_tag "company[logo]" %>
< %= form.submit %>
< % end %>
Top comments (0)