我是Rails的新手我有一个HTML表单,但我不知道如何保留CSS类。只需将表单转换为rails。
<form action="#" method="post" autocomplete="off">
<div class="lx-contact-field">
<input type="text" name="fullname" placeholder="Jane Doe" />
</div>
<div class="lx-contact-field">
<input type="text" name="email" placeholder="Jane@Doe.com" />
</div>
<div class="lx-contact-field">
<textarea name="message" placeholder="Your message here ..."></textarea>
</div>
<input type="button" name="submit" value="SEND MESSAGE" />
</form>
答案 0 :(得分:0)
您可以在div中保留CSS类,并将Rtml输入字段替换为Rails textfield
<div class="lx-contact-field">
<%= f.text_field :full_name, placeholder: "Jane Doe" %>
</div>