Rails MVC, Active Record, routes, migrations, validations, associations, convention over configuration and testing.
40 cards · basic cards · AI-written, checked twice. Edit anything.
- What does MVC stand for?
Show answer
Model, View, Controller
- In Rails MVC, what does a Model represent?
Show answer
The data and business logic of the application
- In Rails MVC, what does a View represent?
Show answer
The user interface displayed to the user
- In Rails MVC, what does a Controller do?
Show answer
Handles requests, processes data, and returns responses
- What is Active Record in Rails?
Show answer
An ORM library that maps database tables to Ruby classes
- How does Active Record represent database tables?
Show answer
Each table is represented by a Ruby class, each row by an object
- What command creates a new Rails application?
Show answer
rails new [app_name]
- What is a Rails generator?
Show answer
A command-line tool that creates files and code scaffolding
- What is a migration in Rails?
Show answer
A reversible version-controlled database schema change
- What command creates a migration file?
Show answer
rails generate migration [migration_name]
- What does 'rails db:migrate' do?
Show answer
Executes pending migrations to update the database schema
- How do you roll back the last migration in Rails?
Show answer
rails db:rollback
- What is the purpose of model validation in Rails?
Show answer
To ensure data integrity by checking attribute values before saving
- What validation checks that an attribute is not blank?
Show answer
validates :attribute, presence: true
- What validation ensures an attribute value is unique in the database?
Show answer
validates :attribute, uniqueness: true