开发者

Writing a ruby file_field in html

开发者 https://www.devze.com 2023-03-27 09:48 出处:网络
<%= 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
<%= 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">
0

精彩评论

暂无评论...
验证码 换一张
取 消