Writing a ruby file_field in html
<%= f.file_field :photo %>
How do I write this in html? I know that it's an input type="file" bu开发者_高级运维t how can I put in the :photo? I need to customise the field by writing it in html in rails.
f is the oject name, photo is the attribute name, so you have
id="object_photo"
name="object[photo]"
<input type="file" size="20" name="object[photo]" id="object_photo">
精彩评论