Ruby Developer Question:

Explain me what is the naming convention in Rails?

Tweet Share WhatsApp

Answer:

☛ Variables: For declaring Variables, all letters are lowercase, and words are separated by underscores
☛ Class and Module: Modules and Classes uses MixedCase and have no underscore; each word starts with a uppercase letter
☛ Database Table: The database table name should have lowercase letters and underscore between words, and all table names should be in the plural form for example invoice_items
☛ Model: It is represented by unbroken MixedCase and always have singular with the table name
☛ Controller: Controller class names are represented in plural form, such that OrdersController would be the controller for the order table.

Download Ruby Developer PDF Read All 74 Ruby Developer Questions
Previous QuestionNext Question
Explain me what is the difference between Symbol and String?Can you explain me how Rails implements Ajax?