From 6045b6cb1880b27e8b21799b9501a794a5f5b88b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 5 Mar 2016 22:43:05 +0100 Subject: Customizing devise views and controllers --- app/views/auth/passwords/edit.html.erb | 25 +++++++++++++++++++++++++ app/views/auth/passwords/new.html.haml | 9 +++++++++ 2 files changed, 34 insertions(+) create mode 100644 app/views/auth/passwords/edit.html.erb create mode 100644 app/views/auth/passwords/new.html.haml (limited to 'app/views/auth/passwords') diff --git a/app/views/auth/passwords/edit.html.erb b/app/views/auth/passwords/edit.html.erb new file mode 100644 index 000000000..6a796b050 --- /dev/null +++ b/app/views/auth/passwords/edit.html.erb @@ -0,0 +1,25 @@ +

Change your password

+ +<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> + <%= devise_error_messages! %> + <%= f.hidden_field :reset_password_token %> + +
+ <%= f.label :password, "New password" %>
+ <% if @minimum_password_length %> + (<%= @minimum_password_length %> characters minimum)
+ <% end %> + <%= f.password_field :password, autofocus: true, autocomplete: "off" %> +
+ +
+ <%= f.label :password_confirmation, "Confirm new password" %>
+ <%= f.password_field :password_confirmation, autocomplete: "off" %> +
+ +
+ <%= f.submit "Change my password" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/auth/passwords/new.html.haml b/app/views/auth/passwords/new.html.haml new file mode 100644 index 000000000..2677feea0 --- /dev/null +++ b/app/views/auth/passwords/new.html.haml @@ -0,0 +1,9 @@ += form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| + = devise_error_messages! + + .field + = f.email_field :email, autofocus: true, required: true, placeholder: 'E-mail address' + .actions + = f.button "Reset password", type: 'submit' + +.form-footer= render "auth/shared/links" -- cgit