向rails表单帮助器添加html属性
我正在自定义默认设置,在会话视图中设计new.html.erb,以便生成如下html代码向rails表单帮助器添加html属性,html,forms,devise,helper,Html,Forms,Devise,Helper,我正在自定义默认设置,在会话视图中设计new.html.erb,以便生成如下html代码 <form class="form-signin" role="form"> <h2 class="form-signin-heading">Please sign in</h2> <input type="text" class="form-control" placeholder="Email address" required autofo
<form class="form-signin" role="form">
<h2 class="form-signin-heading">Please sign in</h2>
<input type="text" class="form-control" placeholder="Email address" required autofocus>
<input type="password" class="form-control" placeholder="Password" required>
<label class="checkbox">
<input type="checkbox" value="remember-me"> Remember me
</label>
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
我不确定下一步要修改什么
<div><%= f.label :email %><br />
<%= f.email_field :email %></div>
所以它生成了:
???
谢谢大家!
<%= f.text_field :email, placeholder: "Email address",
required: true, autofocus: true %>
应该有用
<%= f.text_field :email, placeholder: "Email address",
required: true, autofocus: true %>