Reputation: 2063
I have a form:
<%= form_tag :controller => "foo", :action => "boo", :multipart => true do %>
<%= file_field_tag "foo[bar]" %>
<% end %>
When I submit it, the param foo[bar]
gives "foo[bar]"=>"filename.png"
instead of an ActionDispatch
object.
Anybody have any clues what might be the cause here?
Thanks!
Upvotes: 12
Views: 11196
Reputation: 2063
Solved. Needed to change the form_tag line to:
<%= form_tag ({:controller => "foo", :action => "boo"}), :enctype =>"multipart/form-data" do %>
<%= file_field_tag "foo[bar]" %>
<% end %>
Upvotes: 22