Skip to content

Commit

Permalink
Use relative paths on AR basics guide [ci skip]
Browse files Browse the repository at this point in the history
Most other examples follow this pattern. Plus, using a relative filepath
on the code block will now remove it when using the copy button.
  • Loading branch information
carlosantoniodasilva committed Apr 10, 2024
1 parent 6e551d2 commit 8499757
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions guides/source/active_record_basics.md
Expand Up @@ -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|
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8499757

Please sign in to comment.