How to handle a model with fixed content in Rails?

In some of my forms, I have to provide a drop-down list where users can select certain areas. The fact is that there will always be a fixed number of districts (in this case 31). Should I create a model with a name Districtwith only a string field, fill it with data and do with it?

Content will not change over time. Is there another way?

+3
source share
3 answers

You should take a look at jnunemakers scam-gem . It simulates AR for you and allows you to define models in a Rails application without a database / support table.

, - . psuedo / , , , -.

+2

- . AR-, - collection_select.

+1

, , , - ..

, , ( ), , , - ..

+1

All Articles