Last active
August 29, 2015 13:56
-
-
Save bhaskarkotu/9048919 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_tag({action: 'storedata', controller: 'profileinfo'}, multipart: true) do %> | |
<%= file_field_tag :file %> | |
<%= submit_tag %> | |
<% end %> | |
<form accept-charset="UTF-8" action="/profileinfo/storedata" enctype="multipart/form-data" method="post"> | |
<div style="margin:0;padding:0;display:inline"> | |
<input name="utf8" type="hidden" value="✓" /> | |
<input name="authenticity_token" type="hidden" value="EMXCLkxw84pdO1+AWacyzti8ok8b5jDj5H6u2BmBBMc=" /> | |
</div> | |
<input id="file" name="file" type="file" /> | |
<input name="commit" type="submit" value="Save changes" /> | |
</form> | |
http://stackoverflow.com/questions/11895829/uploading-file-in-rails-gives-string-filename-instead-of-file-or-stringio-object | |
http://guides.rubyonrails.org/v3.2.13/form_helpers.html#uploading-files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
try putting multipart:true in brackets as well
<%= form_tag({action: 'storedata', controller: 'profileinfo'}, {multipart: true}) do %>