Browse Source

update from put to patch

As per the notice in this documenation:
https://github.com/heartcombo/devise/wiki/How-To:-Allow-users-to-edit-their-password
pull/110/head
MadeTech Dushan 4 years ago
parent
commit
0f7270d611
  1. 2
      app/views/devise/registrations/edit.html.erb
  2. 2
      config/routes.rb

2
app/views/devise/registrations/edit.html.erb

@ -2,7 +2,7 @@
<%= link_to 'Back', :back, class: "govuk-back-link" %>
<% end %>
<%= form_for(resource, as: resource_name, url: user_registration_path(), html: { method: :put }) do |f| %>
<%= form_for(resource, as: resource_name, url: user_registration_path(), html: { method: :patch }) do |f| %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l">Change your password</h1>

2
config/routes.rb

@ -5,7 +5,7 @@ Rails.application.routes.draw do
end
as :user do
get 'users/edit' => 'devise/registrations#edit', :as => 'edit_user_registration'
put 'users' => 'users/registrations#update', :as => 'user_registration'
patch 'users' => 'users/registrations#update', :as => 'user_registration'
end
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html

Loading…
Cancel
Save