This is the sample application for Ruby on Rails Tutorial: Learn Web Development with Rails by Michael Hartl.
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.
This application use Dropbox API to storing pictures with production. You should follow next settings. I referenced this.
-
Register Dropbox.
-
Get API token from Dropbox setting.
-
Access "Create App".
-
Choose Dropbox API in "Choose an API".
-
Choose App folder in "Choose the type of access you need".
-
Input your app name in "Choose the type of access you need".
-
Memorize "App key" and "App secret".
-
-
Authorize to access to Dropbox.
- Install gems with bundler(if yet).
$ bundle install --without production
- Run this command.
$ rake dropbox:authorize APP_KEY=<your_app_key> APP_SECRET=<your_app_secret> ACCESS_TYPE=dropbox
-
Access showed URL and authorize.
-
Return to console and input "y"
-
Memorize showed access_token, access_token_secret, and user_id.
-
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>
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.