title: Devise Omniauth-facebook No route matches [GET] "/users/auth/facebook/callback"
body: <p>I got a question will trying to use <strong>omniauth-facebook</strong> with <strong>devise</strong>
  I followed this <a href="http://railscasts.com/episodes/235-devise-and-omniauth-revised" rel="nofollow">railscast video</a>(just substitute twitter with facebook) and was able to get it work.
  However, I would like to customize my routes a little bit, so this is what I did:</p>
  
  <p><strong>config/routes.rb</strong></p>
  
  <pre><code>devise_for :users, path: 'accounts', 
             controllers: { omniauth_callbacks: "omniauth_callbacks" },
             path_names: { sign_in: "login", sign_out: "logout", sign_up: "signup" }
  </code></pre>
  
  <p><strong>app/controllers/omniauth_callbacks_controller.rb</strong></p>
  
  <pre><code>class OmniauthCallbacksController &lt; Devise::OmniauthCallbacksController
    def all
      user = User.from_omniauth(request.env["omniauth.auth"])
      if user.persisted?
        flash.notice = "Successfully signed in via #{request.env["omniauth.auth"].provider}!"
        sign_in_and_redirect user
      else
        session["devise.user_attributes"] = user.attributes
        redirect_to new_user_registration_url
      end
    end
    alias_method :facebook, :all
  end
  </code></pre>
  
  <p>as I expected, in my url "users/..." was changed to "accounts/...", but when I tried to login via facebook, I got this error:
  <code>Routing Error</code>
  <code>No route matches [GET] "/users/auth/facebook/callback"</code></p>
  
  <p>after play around with it, I got around it by adding this line:</p>
  
  <p><strong>config/routes.rb</strong></p>
  
  <pre><code>get '/users/auth/facebook/callback', to: redirect('/accounts/auth/facebook/callback')
  </code></pre>
  
  <p>It works fine now, but I think there must be better solution. </p>
  
  <p>Is there any way to change the returned callback url from <code>/users/auth/facebook/callback</code> to <code>/accounts/auth/facebook/callback</code>    ???</p>
  
  <p>Thanks!</p>