Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Rails gem that allows you to easily interact with an Oauth secured rest API with the ActiveResource model.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 oauth-activeresource.gemspec
README.rdoc

OauthActiveResource

Rails gem that allows you to easily interact with an Oauth secured rest API with the ActiveResource model. You have to provide an http-like object that signs your requests with your already retrieved access_token, like the one that the oauth gem provides (oauth.rubyforge.org/rdoc/classes/OAuth/AccessToken.html)

Getting Started

Assuming that you are using oauth gem:

  1. Add into your Gemfile:

    gem 'oauth-activeresource'
  2. Make your models inherit from OauthActiveResource instead ActiveResource

    class MyModel < OauthActiveResource::Base
    end
  3. Set a before_filter in your controllers to override your connection object with your access_token object

    def set_oauth
      MyModel.oauth_connection = @access_token
    end

Where @access_token is the final object that the oauth gem uses to sign every request. More info about how to create that object here (oauth.rubyforge.org/)

Something went wrong with that request. Please try again.