Hi,

I'm trying to define multiple choices inside the rails model.
In Django I would do something like this:

location = models.CharField(
                                         max_length=3,
                                         choices=LOCATION_CHOICES,
                                         help_text="Which location do
you prefer?"
                                         )

LOCATION_CHOICES = (
                                      ('AMS', 'Amsterdam'),
                                      ('RTM', 'Rotterdam'),
                                      ('HAG', 'The Hague'),
)

What is the Rails equivalent of the above code?
I've tried searching the Rails docs and Googling, but with no luck.

Thanks!

--

You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to