Use relative paths on AR basics guide [ci skip]

Most other examples follow this pattern. Plus, using a relative filepath
on the code block will now remove it when using the copy button.
This commit is contained in:
Carlos Antonio da Silva 2024-04-10 14:26:59 -03:00
parent 6e551d2874
commit 84997578c5
1 changed files with 3 additions and 3 deletions

View File

@ -211,7 +211,7 @@ and results in this:
# The `id` column, as the primary key, is automatically created by convention.
# Columns `created_at` and `updated_at` are added by `t.timestamps`.
# /db/migrate/20240220143807_create_books.rb
# db/migrate/20240220143807_create_books.rb
class CreateBooks < ActiveRecord::Migration
def change
create_table :books do |t|
@ -241,8 +241,8 @@ irb> book.title
NOTE: You can generate the Active Record model class as well as a matching
migration with the command `bin/rails generate model Book title:string
author:string`. This creates the files `/app/models/book.rb`,
`/db/migrate/20240220143807_create_books.rb`, and a couple others for testing
author:string`. This creates the files `app/models/book.rb`,
`db/migrate/20240220143807_create_books.rb`, and a couple others for testing
purposes.
### Creating Namespaced Models