Skip to content

Latest commit

 

History

History
88 lines (59 loc) · 2.16 KB

README.md

File metadata and controls

88 lines (59 loc) · 2.16 KB

Ruby on Rails Tutorial sample application

This is the sample application for Ruby on Rails Tutorial: Learn Web Development with Rails by Michael Hartl.

License

All source code in the Ruby on Rails Tutorial is available jointly under the MIT License and the Beerware License. See LICENSE.md for details.

Setting for Dropbox

This application use Dropbox API to storing pictures with production. You should follow next settings. I referenced this.

  1. Register Dropbox.

  2. Get API token from Dropbox setting.

    1. Access "Create App".

    2. Choose Dropbox API in "Choose an API".

    3. Choose App folder in "Choose the type of access you need".

    4. Input your app name in "Choose the type of access you need".

    5. Memorize "App key" and "App secret".

  3. Authorize to access to Dropbox.

    1. Install gems with bundler(if yet).
    $ bundle install --without production
    
    1. Run this command.
    $ rake dropbox:authorize APP_KEY=<your_app_key> APP_SECRET=<your_app_secret> ACCESS_TYPE=dropbox
    
    1. Access showed URL and authorize.

    2. Return to console and input "y"

    3. Memorize showed access_token, access_token_secret, and user_id.

  4. Set tokens in Dropbox to heroku env

$ heroku config:set APP_KEY=<your_app_key>
$ heroku config:set APP_SECRET=<your_app_secret>
$ heroku config:set ACCESS_TOKEN=<your_access_token>
$ heroku config:set ACCESS_TOKEN_SECRET=<your_access_token_secret>
$ heroku config:set USER_ID=<your_user_id>

Getting started

To get started with the app, clone the repo and then install the needed gems:

$ bundle install --without production

Next, migrate the database:

$ rails db:migrate

Finally, run the test suite to verify that everything is working correctly:

$ rails test

If the test suite passes, you'll be ready to run the app in a local server:

$ rails server

For more information, see the Ruby on Rails Tutorial book.