title: Rails 3: how to pull change password out to be its own separate form from devise
body: <p>I'm using devise for my user registrations and I'd like to have a separate edit path for user's to change/update their passwords. I've pulled the devise registrations views out and created a separate registrations controller like described in <a href="http://railscasts.com/episodes/236-omniauth-part-2" rel="nofollow">Railscast 236</a></p>
  
  <p>I've tried creating a new action called change_password in the registrations controller but when I try to set the route with match '/change_password', to => 'registrations#change_password' I get an AbstractController::Actions Not Found</p>
  
  <h2>registrations controller</h2>
  
  <pre><code>class RegistrationsController &lt; Devise::RegistrationsController
  
  def create
    super
    session[:omniauth] = nil unless @user.new_record?
   end
  
   def destroy
     resource.destroy 
     set_flash_message :notice, :destroyed
     sign_out_and_redirect(self.resource)
   end
  
   def change_password
     render_with_scope :edit
   end
  
  private
    def build_resource(*args)
     super
     if session[:omniauth]
       @user.apply_omniauth(session[:omniauth])
       @user.valid?
     end
   end
  </code></pre>
  
  <h2>routes.rb</h2>
  
  <pre><code>  match 'auth/:provider/callback' =&gt; 'authentications#create'
    resources :authentications
  
    devise_for :users, :controllers =&gt; {:registrations =&gt; 'registrations'}
  
  
  
  
    resources :posts do
        member do
        get :likers
        end
         collection do
          get :search
        end
    end  
  
    resources :relationships, :only =&gt; [:create, :destroy]
    resources :appreciations, :only =&gt; [:create, :destroy]
  
     root :to =&gt; "pages#home"
  
    match '/contact', :to =&gt; 'pages#contact'
    match '/about',   :to =&gt; 'pages#about'
    match '/help',    :to =&gt; 'pages#help'
    match '/blog',    :to =&gt; 'pages#blog'
  
  
    resources :users do
       member do
       get :following, :followers, :likes
       end
       resources :collections
   end
  end
  </code></pre>
  
  <h2>views/registrations/change_password.html.erb</h2>
  
  <pre><code>&lt;h2&gt;Edit &lt;%= resource_name.to_s.humanize %&gt;&lt;/h2&gt;
  
  &lt;%= form_for(resource, :as =&gt; resource_name, :url =&gt; registration_path(resource_name), :validate =&gt; true,
                     :html =&gt; { :method =&gt; :put }, :html =&gt; {:multipart =&gt; true}) do |f| %&gt;  
     &lt;%= devise_error_messages! %&gt; 
    &lt;p&gt;&lt;strong&gt;To change password, otherwise leave blank.&lt;/strong&gt;&lt;/p&gt;
    &lt;p&gt;&lt;%= f.label :current_password %&gt; &lt;i&gt;(leave blank if you don't want to change it)&lt;/i&gt;&lt;br /&gt;
    &lt;%= f.password_field :current_password %&gt;&lt;/p&gt;
    &lt;p&gt;&lt;%= f.label :password, "New password" %&gt; &lt;br /&gt;
    &lt;%= f.password_field :password %&gt;&lt;/p&gt;
    &lt;p&gt;&lt;%= f.label :password_confirmation %&gt;&lt;br /&gt;
    &lt;%= f.password_field :password_confirmation %&gt;&lt;/p&gt;
    &lt;/div&gt;&lt;br /&gt;
    &lt;p&gt;&lt;%= f.submit "Update" %&gt;&lt;/p&gt;
  &lt;% end %&gt;
  </code></pre>