{"id":15152653,"url":"https://github.com/oliviercalmels/sample_app","last_synced_at":"2026-01-20T18:56:03.081Z","repository":{"id":54283820,"uuid":"328604706","full_name":"OlivierCalmels/sample_app","owner":"OlivierCalmels","description":"This is the implementation of the sample application from Ruby on Rails Tutorial: Learn Web Development with Rails (6th Edition) by Michael Hartl.","archived":false,"fork":false,"pushed_at":"2021-09-16T13:42:21.000Z","size":492,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-13T13:52:58.463Z","etag":null,"topics":["rails-tutorial","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OlivierCalmels.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-11T09:01:15.000Z","updated_at":"2021-09-16T13:42:24.000Z","dependencies_parsed_at":"2022-08-13T11:00:19.619Z","dependency_job_id":null,"html_url":"https://github.com/OlivierCalmels/sample_app","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlivierCalmels%2Fsample_app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlivierCalmels%2Fsample_app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlivierCalmels%2Fsample_app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OlivierCalmels%2Fsample_app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OlivierCalmels","download_url":"https://codeload.github.com/OlivierCalmels/sample_app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640472,"owners_count":20971558,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rails-tutorial","ruby"],"created_at":"2024-09-26T16:20:51.232Z","updated_at":"2026-01-20T18:56:03.033Z","avatar_url":"https://github.com/OlivierCalmels.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruby on Rails Tutorial sample application\r\n\r\n## Reference implementation\r\n\r\nThis is the reference implementation of the sample application from\r\n[*Ruby on Rails Tutorial:\r\nLearn Web Development with Rails*](https://www.railstutorial.org/)\r\n(6th Edition)\r\n\u003c!-- by [Michael Hartl](http://www.michaelhartl.com/). --\u003e\r\n\r\n## License\r\n\r\nAll source code in the [Ruby on Rails Tutorial](https://www.railstutorial.org/)\r\nis available jointly under the MIT License and the Beerware License. See\r\n[LICENSE.md](LICENSE.md) for details.\r\n\r\n## Getting started\r\n\r\nTo get started with the app, first clone the repo and `cd` into the directory:\r\n\r\n```\r\n$ git clone https://github.com/mhartl/sample_app_6th_ed.git\r\n$ cd sample_app_6th_ed\r\n```\r\n\r\nThen install the needed packages (while skipping any Ruby gems needed only in production):\r\n\r\n```\r\n$ yarn add jquery@3.5.1 bootstrap@3.4.1\r\n$ bundle install --without production\r\n```\r\n\r\n(If you run into any installation issues or missing dependencies, refer to the [first chapter](https://www.learnenough.com/ruby-on-rails-6th-edition-tutorial/beginning) of the tutorial for details.)\r\n\r\nNext, migrate the database:\r\n\r\n```\r\n$ rails db:migrate\r\n```\r\n\r\nFinally, run the test suite to verify that everything is working correctly:\r\n\r\n```\r\n$ rails test\r\n```\r\n\r\nIf the test suite passes, you’ll be ready to seed the database with sample users and run the app in a local server:\r\n\r\n```\r\n$ rails db:seed\r\n$ rails server\r\n```\r\n\r\nYou can then register a new user or log in as the sample administrative user with the email `example@railstutorial.org` and password `foobar`.\r\n\r\n## Deploying\r\n\r\nTo deploy the sample app to production, you’ll need a Heroku account as discussed [Section 1.4, “Deploying”](https://www.railstutorial.org/book/beginning#sec-deploying).\r\n\r\nThe full production app includes several advanced features, including sending email with [SendGrid](https://sendgrid.com/) and storing uploaded images with [AWS S3](https://aws.amazon.com/s3/). As a result, deploying the full sample app can be rather challenging. The suggested method for testing a deployment is to use the branch for Chapter 10 (“Updating users”), which doesn’t require more advanced settings but still includes sample users.\r\n\r\nTo deploy this version of the app, you’ll need to create a new Heroku application, switch to the right branch, push up the source, run the migrations, and seed the database with sample users:\r\n\r\n```\r\n$ heroku create\r\n$ git checkout updating-users\r\n$ git push heroku updating-users:master\r\n$ heroku run rails db:migrate\r\n$ heroku run rails db:seed\r\n```\r\n\r\nVisiting the URL returned by the original `heroku create` should now show you the sample app running in production. As with the local version, you can then register a new user or log in as the sample administrative user with the email `example@railstutorial.org` and password `foobar`.\r\n\r\n## Branches\r\n\r\nThe reference app repository includes a separate branch for each chapter in the tutorial (Chapters 3–14). To examine the code as it appears at the end of a particular chapter (with some slight variations, such as occasional exercise answers), simply check out the corresponding branch using `git checkout`:\r\n\r\n```\r\n$ git checkout \u003cbranch name\u003e\r\n```\r\n\r\nA full list of branch names appears as follows (preceded the number of the corresponding chapter in the book):\r\n\r\n```\r\n 3. static-pages\r\n 4. rails-flavored-ruby\r\n 5. filling-in-layout\r\n 6. modeling-users\r\n 7. sign-up\r\n 8. basic-login\r\n 9. advanced-login\r\n10. updating-users\r\n11. account-activation\r\n12. password-reset\r\n13. user-microposts\r\n14. following-users\r\n```\r\n\r\nFor example, to check out the branch for Chapter 7, you would run this at the command line:\r\n\r\n```\r\n$ git checkout sign-up\r\n```\r\n\r\n## Help with the Rails Tutoiral\r\n\r\nExperience shows that comparing code with the reference app is often helpful for debugging errors and tracking down discrepancies. For additional assistance with any issues in the tutorial, please consult the [Rails Tutorial Help page](https://www.railstutorial.org/help).\r\n\r\nSuspected errors, typos, and bugs can be emailed to \u003chelp@learnenough.com\u003e. All such reports are gratefully received, but please double-check with the [online version of the tutorial](https://www.railstutorial.org/book) and this reference app before submitting.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliviercalmels%2Fsample_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliviercalmels%2Fsample_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliviercalmels%2Fsample_app/lists"}