Take the 2-minute tour ×

Should this routes.rb code:

  resource :oauths do
    get :callback

be equivalent to:

  match "oauth/callback" => "oauths#callback"

? If I use first variant and get undefined callback when accessing oauth/callback, the second method works, is there a variant to do this using "resource"?

share|improve this question

1 Answer 1

Consider setting up a collection route,

resource :oauths do
  get :callback, :on => :collection

You'll also get the callback_oauths_path route helper.

share|improve this answer
Yes I too found it in the docs, but it does not work to in my case: undefined method `callback' for Sorcery::Controller::Config:Module and with match "oauth/callback" => "oauths#callback" it works –  WHITECOLOR Oct 27 '11 at 18:44

Your Answer


