Manually Testing Your Models

suggest change

You can exercise Active Record models from the app directory with rails console.

If the users table has name and email string columns:

User.create name: "John", email: "john@example.com"

To load that record:

User.find_by email: "john@example.com"

Or, if it is the only row, load the first record:

User.first

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents