Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

Static table values in Rails

I'm creating a rails app where I want to assign users a role and access level, e.g, admin etc. I would like to store this list of levels in a database table so I can autopopulate certain forms and views. How would I do this? I'm sure I need to build a regular rails model class but how would I assign it to a form control like a dropdown? I want to have a dropdown that pulls in each of the access levels from that table.

Any guidance would be warmly appreciated.

Steven Parker
Steven Parker
231,007 Points

Did you post this question to the wrong topic area? You can change it to "Rails" by clicking on the little rectangle with the three dots in it and selecting "Edit Question".