开发者

Best way to handle per user Settings in Rails 3

开发者 https://www.devze.com 2023-03-10 17:19 出处:网络
I\'m developing an application in Rails 3. In the application, users are allowed to send e-mails using their existing email account settings. What\'s 开发者_StackOverflow中文版the best approach to def

I'm developing an application in Rails 3. In the application, users are allowed to send e-mails using their existing email account settings. What's 开发者_StackOverflow中文版the best approach to define per user settings for every user's credentials?

Regards, Liviu


Given you'd probably want to offer the option for users to change/update their settings, they should go in a model. After that, it comes down to taste...

If you have only a few settings, you could store them directly in the User model. If you have lots of settings, you could have a separate UserProfile model that belongs_to User.

0

精彩评论

暂无评论...
验证码 换一张
取 消