“我的设计”的“忘记密码”按钮有时起作用,有时不起作用。好像当我第一次单击“忘记密码?”时,链接,它不起作用(按钮没有单击),但是如果刷新,就可以了。
这是生产链接(发生在开发人员中):https://www.makerspro.io/users/sign_in
任何想法都将不胜感激!
这是我的观点:
<body id="homepage">
<div class="container">
<div class="row h-100 justify-content-center align-items-center">
<div class="card card-outline-secondary" style="width: 42rem;">
<div class="card-header">
<h3 class="mb-0">Forgot your password?</h3>
</div>
<div class="card-body">
<div class="form-group">
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
<%= devise_error_messages! %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: "form-control" %><br />
</div>
</div>
<div class="actions">
<%= f.submit "Send me reset password instructions", class: "btn btn-lg btn-primary btn-block" %>
</div>
<% end %>
<div class="card-footer">
<%= render "devise/shared/links" %>
</div>
</div>
<!--/card-body-->
</div>
<!-- /form card -->
</div>
</div>
</body>
还有我的控制器:
class PasswordsController < Devise::PasswordsController
layout 'pages'
skip_before_action :read_cookies
skip_before_action :authenticate_user!
end
我的路线:
devise_for :users,
controllers: { registrations: :registrations,
sessions: :sessions,
passwords: :passwords,
confirmations: :confirmations,
unlocks: :unlocks
}
谢谢!