Pergunta

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.

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top