title: Destroy User not working on Rails
body: <p>I'm using devise on my Users controller right now and can't seem to destroy my users. Edit, new still work. Destroy only redirects me to showing the user attributes.</p>
  
  <p>My User Controller:</p>
  
  <pre><code>class UsersController &lt; ApplicationController
  
  def new
      @user = User.new
  end
  
  def create
      @user = User.new(user_params)
      if @user.save
      redirect_to users_path
      else
      render 'new'
      end
  end
  
    def index
      @users=User.all
    end
  
  def edit
  @user = User.find(params[:id])
  end
  
  def destroy
      @user = User.find(params[:id])
      @user.destroy
      redirect_to users_path
  end
  
  def delete
  
  end
  
  def update
   @user = User.find(params[:id])
   if @user.update_attributes(user_params)
    redirect_to user_path(@user.id)
   else
    render 'edit'
   end
  end
  
  def show
      @user = User.find(params[:id])
  end
  
  private
  
      def user_params
          params.require(:user).permit(:name, :email, :password)
      end
  
  end
  </code></pre>
  
  <p>User View:</p>
  
  <pre><code>&lt;h1&gt;Users#index&lt;/h1&gt;
  &lt;p&gt;Find me in app/views/users/index.html.erb&lt;/p&gt;
  
  &lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt;name&lt;/td&gt;
          &lt;td&gt;email&lt;/td&gt;
          &lt;td&gt;password&lt;/td&gt;
      &lt;/tr&gt;
      &lt;% @users.each do |user| %&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;%= link_to user.name, user_path(user.id) %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= user.email %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= user.password %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= link_to "edit user", edit_user_path(user.id) %&gt; &lt;/td&gt;
          &lt;td&gt;&lt;%= link_to "destroy user", user, method: :delete %&gt; &lt;/td&gt;
      &lt;/tr&gt;
  
  
      &lt;% end %&gt;
  
  &lt;/table&gt;
  </code></pre>
  
  <p>Does it have something to do with the </p>
  
  <pre><code>&lt;td&gt;&lt;%= link_to "destroy user", user, method: :delete %&gt; &lt;/td&gt;
  </code></pre>
  
  <p>line? It seems like this is the line that is giving me the most trouble. I am using devise if that is relevant, and I am also having issues trying to get it fixed.</p>
  
  <p>My rake routes:</p>
  
  <pre><code>                  Prefix Verb   URI Pattern                    Controller#Action
          new_user_session GET    /users/sign_in(.:format)       devise/sessions#new
              user_session POST   /users/sign_in(.:format)       devise/sessions#create
      destroy_user_session DELETE /users/sign_out(.:format)      devise/sessions#destroy
             user_password POST   /users/password(.:format)      devise/passwords#create
         new_user_password GET    /users/password/new(.:format)  devise/passwords#new
        edit_user_password GET    /users/password/edit(.:format) devise/passwords#edit
                           PATCH  /users/password(.:format)      devise/passwords#update
                           PUT    /users/password(.:format)      devise/passwords#update
  cancel_user_registration GET    /users/cancel(.:format)        devise/registrations#cancel
         user_registration POST   /users(.:format)               devise/registrations#create
     new_user_registration GET    /users/sign_up(.:format)       devise/registrations#new
    edit_user_registration GET    /users/edit(.:format)          devise/registrations#edit
                           PATCH  /users(.:format)               devise/registrations#update
                           PUT    /users(.:format)               devise/registrations#update
                           DELETE /users(.:format)               devise/registrations#destroy
                     posts GET    /posts(.:format)               posts#index
                           POST   /posts(.:format)               posts#create
                  new_post GET    /posts/new(.:format)           posts#new
                 edit_post GET    /posts/:id/edit(.:format)      posts#edit
                      post GET    /posts/:id(.:format)           posts#show
                           PATCH  /posts/:id(.:format)           posts#update
                           PUT    /posts/:id(.:format)           posts#update
                           DELETE /posts/:id(.:format)           posts#destroy
                     users GET    /users(.:format)               users#index
                           POST   /users(.:format)               users#create
                  new_user GET    /users/new(.:format)           users#new
                 edit_user GET    /users/:id/edit(.:format)      users#edit
                      user GET    /users/:id(.:format)           users#show
                           PATCH  /users/:id(.:format)           users#update
                           PUT    /users/:id(.:format)           users#update
                           DELETE /users/:id(.:format)           users#destroy
  </code></pre>