I am using Rails 4 with Devise. I have a very simple form that should allow the user to update their password.
<%= form_for current_user, url: edit_user_registration_path, remote: true do |f| %>
<div class="form-group current-password-container">
<%= f.label :current_password, "Old password", class: "control-label" %>
<div class="controls">
<div class="input-group col-xs-12">
<%= f.text_field :current_password, class: "form-control", data: { errorclass: "current-password-container" } %>
</div>
<div id="current-password-container-validation-message"></div>
</div>
</div>
<div class="form-group password-container">
<%= f.label :password, "New password", class: "control-label" %>
<div class="controls">
<div class="input-group col-xs-12">
<%= f.text_field :password, class: "form-control", data: { errorclass: "password-container" } %>
</div>
<div id="password-container-validation-message"></div>
</div>
</div>
<div class="form-group password-confirmation-container">
<%= f.label :password_confirmation, "Confirm new password", class: "control-label" %>
<div class="controls">
<div class="input-group col-xs-12">
<%= f.text_field :password_confirmation, class: "form-control", data: { errorclass: "password-confirmation-container" } %>
</div>
<div id="password-confirmation-container-validation-message"></div>
</div>
</div>
<%= f.submit "Update Password", class: "btn btn-primary btn-lg" %>
<% end %>
Here is the routes file:
devise_for :users, controllers: { registrations: "users/registrations" }
devise_scope :user do
get "/sign_in", to: "devise/sessions#new"
end
authenticated :user do
devise_scope :user do
root to: "users/agents/dashboard#index", as: :authenticated_root
end
end
unauthenticated :user do
devise_scope :user do
root to: "devise/sessions#new", as: :root
end
end
namespace :users do
namespace :agents do
resources :dashboard, only: [:index]
resources :account
resources :bonds
end
end
The error I get back is the following:
ActionController::RoutingError (No route matches [PATCH] "/users/edit")
And my custom controller is blank (so it should default to using super on every method).
What is going on with this?