Rails scaffold_controller generator doesn't apply model attributes to views

后端 未结 3 1627
情歌与酒
情歌与酒 2020-12-28 16:05

I\'m using the scaffold_controller generator on an existing model with existing attributes, but the view forms that get generated don\'t have any input controls for the corr

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-28 16:49

    This is what it is supposed to do. When calling scaffold_controller you're telling the generator to not use a model. If you want to have form attributes in the views, you need to pass them to the generator just like you would a normal scaffolding.

    rails g scaffold_controller User name email
    

提交回复
热议问题