
Rails Fundamentals
MVC pattern, convention over configuration, Rails project structure, environments
1What does the acronym MVC stand for in the context of Rails?
What does the acronym MVC stand for in the context of Rails?
Answer
MVC stands for Model-View-Controller, an architectural pattern that separates the application into three interconnected components. The Model handles data and business logic, the View displays the user interface, and the Controller orchestrates interactions between the two. This separation facilitates code maintenance and testing.
2What is the main role of the Model in Rails MVC architecture?
What is the main role of the Model in Rails MVC architecture?
Answer
In Rails, the Model represents application data and encapsulates business logic. It interacts with the database via ActiveRecord, manages validations, entity associations, and callbacks. The Model is responsible for data integrity and business rules, independent of the user interface.
3What does the 'Convention over Configuration' principle mean in Rails?
What does the 'Convention over Configuration' principle mean in Rails?
Answer
Convention over Configuration means Rails provides sensible defaults for most aspects of the application. If developers follow naming and structure conventions, Rails automatically configures connections between models, controllers and views. This reduces boilerplate code and accelerates development.
According to Rails conventions, where are controller files stored?
Which directory contains view templates in a Rails application?
+15 interview questions
Other Ruby on Rails interview topics
Ruby Basics
Ruby Object-Oriented Programming
Routing & Controllers
ActiveRecord Basics
Views & ERB Templates
ActiveRecord Associations
Advanced ActiveRecord Queries
Rails Forms
Authentication & Authorization
Modern Asset Pipeline & Frontend
Rails API Mode
Testing with RSpec
ActiveJob & Background Jobs
ActionCable & WebSockets
ActionMailer
ActiveStorage
Caching Strategies
Advanced Migrations
Rails Engines & Modular Apps
Performance Optimization
Rails Design Patterns
Ruby Metaprogramming
Rails Security
GraphQL with Rails
Deployment & Production
Monitoring & Logging
Rails Upgrade Strategies
Master Ruby on Rails for your next interview
Access all questions, flashcards, technical tests, code review exercises and interview simulators.
Start for free