This is the sample application for Ruby on Rails Tutorial: Learn Web Development with Rails (6th Edition) 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.
To get started with the app, clone the repo and then install the needed gems: a S$ bundle install --without production Pi a eae Next, migrate the database: ma S$ rails db:migrate a ee Finally, run the test suite to verify that everything is working correctly: ~~ SN S S rails test ~ & If the test suite passes, you'll be ready to run the app in a local server: ~~ N NS S rails server ~~ SN NS For more information, see the [Ruby on Rails Tutorial book] (https://www.railstutorial.org/book).
$ rails generate controller StaticPages home help
$ rails destroy controller StaticPages home help
$ rails generate model User name:string email:string
$ rails destroy model User
$ rails db:migrate
$ rails db:rollback
$ rails db:migrate VERSION=0
$ rm -f development.sqlite3 the rails db:migrate
$ -> 1. gem 'will_paginate', '3.1.8'. 2. gem 'bootstrap-will_paginate', '1.0.0'
$ rails g migration add_admin_to_users admin:boolean
$ rails db:migrate:reset
$ rails generate model Post content:text user:references
- add_index :posts, [:user_id, :created_at]
$ rails active_storage:install
$ rails g migration add_activation_to_users activation_digest:string activated:boolean activated_at:datetime
$ rails g mailer UserMailer account_activation password_reset
https://guides.rubyonrails.org/routing.html (include/extend in rails)
$ rails g controller PasswordResets new edit --no-test-framework
$ rails g migration add_reset_to_users reset_digest:string reset_sent_at:datetime
$ rails g model Relationship follower_id:integer followed_id:integer