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

前端 未结 5 1605
隐瞒了意图╮
隐瞒了意图╮ 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 13:11

    in rails conntroller and table name are plural model alone is singular.In a two word name second word is pluralized !

提交回复
热议问题