An example of how to quickly set up a rails app with the Shared Learning Collaborative API.
Ruby JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
db
doc
lib
log
public
script
test
vendor
.gitignore
Gemfile
Gemfile.lock
README.rdoc
Rakefile
config.ru

README.rdoc

This example is outdated.

The omniauth-slc gem was renamed to omniauth-inbloom.

Shared Learning Collaborative integration in a Rails App

This is an exmaple of how to use the omniauth-slc gem to authenticate with SLC API, and then use the HTTParty gem to make request to the API.

To set up a sandbox enviroment for SLC, follow this guide: dev.slcedu.org/getting-started/creating-sandbox-account

It uses some of the strategies in Ryan Bate's Railscast #241 Simple OmniAuth: railscasts.com/episodes/241-simple-omniauth.

Setup

To use this app you will need to export environment variables

export SLC_SANDBOX_KEY=YOUR KEY
export SLC_SANDBOX_SECRET=YOUR SECRET

When you create an application as described in “registering your application” at dev.slcedu.org/getting-started/creating-sandbox-account

set your application location to:

http://localhost:3000/

set your callback url to:

http://localhost:3000/auth/slc/callback

Bugs

This was done quickly and is not perfect. If you notice a bug, please submit an issue, or even better, fix it and submit a Pull Request.

Contributing

  1. Fork it

  2. Create your feature branch (`git checkout -b my-new-feature`)

  3. Commit your changes (`git commit -am 'Add some feature'`)

  4. Push to the branch (`git push origin my-new-feature`)

  5. Create a new Pull Request