My template looks like this:
.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
It actually works, but it generates two forms with duplicate ids such as...
<input id="user_email" name="user[email]" size="30" type="email">
How do I change this so the IDs don't duplicate?
You can add namespace to your forms.
=form_for(:user, :as => :user_forgot, :url => password_path(:user), :namespace => 'forgot', :html => { :method => :post }) do |f|
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With