简体   繁体   中英

Best way to handle per user Settings in Rails 3

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 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM