Created
February 12, 2011 06:11
-
-
Save yaotti/823562 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
これをRoR 3.0で使おうとしている | |
https://github.com/tardate/rails-twitter-oauth-sample | |
before_filterのoauth_login_requiredは呼ばれている | |
callback url: hoge.com/users/callback | |
で,コールバック時にエラー | |
Error message | |
>> | |
Unknown action | |
The action 'callback' could not be found for UsersController | |
<< |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
require 'oauth' | |
require 'twitter_oauth' | |
module OauthSystem | |
# controller method to handle twitter callback (expected after login_by_oauth invoked) | |
def callback | |
# ... | |
end | |
# ... | |
protected | |
# private methods ... | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UsersController < ApplicationController | |
# include the oauth_system mixin | |
require 'oauth_system' | |
include OauthSystem | |
# specify oauth to be on all user-specific actions | |
before_filter :oauth_login_required, :except => [ :callback, :signout, :index, :show ] | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment