title: Rails 3 routing error, User class with Devise::OmniauthCallbacksController
body: <p>I'm trying to create a profile page for my users, but I get stuck as soon as the user logs in, due to routing error. Even if I try to load the first page, I get the same problem again. When I do a rake routes, I get these user paths:</p>
  
  <pre><code>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_omniauth_authorize        /users/auth/:provider(.:format)        users/omniauth_callbacks#passthru {:provider=&gt;/facebook|twitter/}
    user_omniauth_callback        /users/auth/:action/callback(.:format) users/omniauth_callbacks#(?-mix:facebook|twitter)
             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
                           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
                           PUT    /users(.:format)                       devise/registrations#update
                           DELETE /users(.:format)                       devise/registrations#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
                           PUT    /users/:id(.:format)                   users#update
                           DELETE /users/:id(.:format)                   users#destroy
  </code></pre>
  
  <p>This is what my Users::OmniauthCallbacksController looks like:</p>
  
  <pre><code>class Users::OmniauthCallbacksController &lt; Devise::OmniauthCallbacksController
    def facebook
      @user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user)
      if @user.persisted?
        sign_in_and_redirect @user, :event =&gt; :authentication
        set_flash_message(:notice, :success, :kind =&gt; "Facebook") if is_navigational_format?
      else
        session["devise.facebook_data"] = request.env["omniauth.auth"]
        redirect_to new_user_registration_url
      end
    end
  end
  </code></pre>
  
  <p>I'm not sure about this, but I thought I should create a UsersController in which I could implement methods outside of the device. This is what it looks like:</p>
  
  <pre><code>class UsersController &lt; ApplicationController
  
      def index
          @users = User.all
  
          respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @ingredients }
      end
      end
  
      def profile
          @user = current_user
  
          respond_to do |format|
        format.html 
        format.json { render json: @ingredients }
      end
      end
  
      def show
          @user = User.find(params[:id])
  
          respond_to do |format|
        format.html 
        format.json { render json: @ingredients }
      end
      end
  
  end
  </code></pre>
  
  <p>In my routes.rb I have the following users related lines: </p>
  
  <pre><code>devise_for :users, :controllers =&gt; { :omniauth_callbacks =&gt; "users/omniauth_callbacks" }
  resources :users
  </code></pre>
  
  <p>Now, If I load the first page while the user is logged in, I get the error: </p>
  
  <pre><code>Routing Error
  
  No route matches {:action=&gt;"show", :controller=&gt;"users"}"
  </code></pre>
  
  <p>Any ideas?</p>