Tôi đang sử dụng đưa ra và các tập tin quan điểm là /devise/registrations/edit.html.erb
(Tôi đã không thực hiện bất kỳ thay đổi nào đó):Tôi đang sử dụng Devise, thay đổi mật khẩu sẽ chuyển hướng đến trang chủ, cách giữ nó trên/người dùng/chỉnh sửa?
<div><%= f.label :password %>
<%= f.password_field :password, :autocomplete => "off" %></div>
<div><%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation %></div>
<% if f.object.encrypted_password.present? %>
<div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
<%= f.password_field :current_password %></div>
<% end %>
<div><%= f.submit "Update" %></div>
Khi người dùng thay đổi mật khẩu của họ, họ sẽ nhận chuyển hướng đến root_url
(trang chủ). Tôi muốn giữ chúng ở trang thay đổi mật khẩu, là /users/edit
. Tôi làm nó như thế nào?
EDIT - Tôi có registration_controller với phương thức chỉnh sửa, tôi nên thêm gì vào đó?
mã điều khiển của bạn sẽ có ích. – vee
@vinodadhikary - Tôi có registration_controller với phương pháp chỉnh sửa, tôi nên thêm gì vào nó? – iCyborg