Ruby on Rails

Rails Fundamentals

MVC pattern, convention over configuration, Rails project structure, environments

18 面接問題·
Junior
1

What does the acronym MVC stand for in the context of Rails?

回答

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.

2

What is the main role of the Model in Rails MVC architecture?

回答

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.

3

What does the 'Convention over Configuration' principle mean in Rails?

回答

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.

4

According to Rails conventions, where are controller files stored?

5

Which directory contains view templates in a Rails application?

+15 面接問題

次の面接に向けてRuby on Railsをマスター

すべての問題、flashcards、技術テスト、コードレビュー演習、面接シミュレーターにアクセス。

無料で始める