ruby - form_tag rails with method: :get and multipart: true -
i'm using from_tag multipart pass file, when use post method works perfectly, if change method param pass filename string.
<%= form_tag receptors_overview_path, method: :get, multipart: true %> <%= file_field_tag :receptors_file, accept: '.xlsx' %> <%= submit_tag 'import!', class: "btn btn-success" %> <% end %> routes
get 'receptors/overview' it's posible work multipart method? or works post method. thx.
i'm going take bold stand here , can't use multipart , together. file contents multipart form carried in entity, need body doesn't have.
there server-side tricks use fake method type interpret post get, perhaps, or serialize upload client-side , pass contents parameter using javascript library, vanilla html form can't (and shouldn't) multipart , get.
Comments
Post a Comment