Associating Two Models in Rails (user and profile)

后端 未结 3 847
無奈伤痛
無奈伤痛 2020-12-29 16:42

I\'m new to Rails. I\'m building an app that has a user model and a profile model.

I want to associate these models such that:
- After the user creates an

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-29 17:26

    For usability sake the profile should be part of the user model, or you should create your account and at least the base of your profile all in one go, as a user I i registered and then had to fill in another form I think I would be pretty annoyed.

    The upside of this is that either way you can do this with one form. I'd look at the railscasts on complex forms and if you can handle a very modest financial outlay then the pragmatic programmers series on Mastering Rails Forms is a total winner.

提交回复
热议问题