Reputation: 75
I am using the following line in my .html.erb file
<@= file_field_tag 'file', :class => 'upload', value => 'index.html' %>
When it is rendered in the browser, it is not displaying the value 'index.html'.
Can someone help me in figuring out how to display the value.
Upvotes: 1
Views: 2857
Reputation: 34774
You can't set a value on a file input in HTML. Therefore you can't do it via rails too.
Otherwise you could set the value in your page and submit the form via javascript and pluck files from your visitors computers.
Upvotes: 2