forms - Rails - Should an object's types be in its own model? -


I have a contact, and the contact is near: Phone column has given a column name, phone_desk where I have to include the type of phone number saved by that user.

My questions / best practices

The options I provided manually (such as "mobile", "work", "home") Should provide a selection with ...

-or -

... create new model name phones_types where I want them to add value, thus each one To create a unique ID, I can call phone_test_id by calling phone_desk, call and add phone: phone_types and phone_types Give the name of a name column:

  @phone = phone.Previously @ phone.type.name  

SidNote

I am currently doing this with the first option (not a separate model) and when there are problems choosing this value, I go to edit the original item. In other words, edit the phone numbers. While selecting, the selected options do not have saved values ​​

This is always the first option selected, so users The phone can change DCC without knowing it inadvertently.

If the first option is actually a better way to go, then any information about how to achieve the value of the object value while editing the details of the phone through a selection?

I still want to go for a different model for the phone type. In this way, you can easily add other phone types later. Thinking about I18n, it can save some headaches while translating "mobile" to Japanese.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -