我的模板如下所示:
.dropdown.light
.login
=form_for("user", :url => user_session_path) do |f|
= f.hidden_field :redirect_to, :value => request.fullpath
= f.email_field :email, :placeholder => "email", :size => ''
= f.password_field :password, :placeholder => "password", :size => ''
div.remember
= f.check_box :remember_me, :checked => "checked"
= f.label :remember_me
.clearfix
a.forgot.pull-left href="#forgot" Forgot your password?
input.pull-right type="submit" value="Sign in"
.forgotten
=form_for(:user,:as => :user_forgot, :url => password_path(:user), :html => { :method => :post }) do |f|
p
strong Reset your password
p.small Give us your e-mail and you’ll be back in a jiffy
div= f.email_field :email
.clearfix
a.forgot.nevermind.pull-left href="#forgot" Nevermind
input.pull-right type="submit" value="Reset password"
.sent
p
strong Email sent!
p In a couple of minutes you should receive an email with a link to reset your password
它确实有效,但它会生成两个具有重复 ID 的表单,例如...
<input id="user_email" name="user[email]" size="30" type="email">
如何更改此设置以使 ID 不重复?