On Tue, Mar 8, 2011 at 9:27 AM, J. Rodrigo Fuentes <
joserodrigofuentes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> Suppose I want to let a user choose different languages when filling out a
> form, like English, Spanish, and Other, where Other is user-specified.
>
> What is the best way to model this in a RoR database? Is it better to have
> a string or an integer that is converted with case-statements to mean
> 1=English, 2=Spanish, 3=Other...?
>
>
If the requirement is as limited as you say than either way is fine. I would
just stick with the string in this case because maintaining which number
equals what language is a maintenance hassle unless you have that stored in
a database.
B.
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.