Ruby on Rails plural (controller) and singular (model) convention - explanation

前端 未结 5 1590
隐瞒了意图╮
隐瞒了意图╮ 2020-12-07 12:31

As per Ruby on Rails convention, controller names get pluralized while model names are singular. Example : a Users controller, but a User model.

rails genera         


        
5条回答
  •  [愿得一人]
    2020-12-07 12:55

    Ruby on Rails follow linguistic convention. That means a model represents a single user, whereas a database table consists of many users.

提交回复
热议问题