Hello, i'm developing a Rails3 application mixing together Gmap4rails
and Devise to build a CMS that allows web developers to make maps
application quickly. The CMS now is based on 2 models.
Location, stores latitude, longitude and name of the marker
Categories, stores the name of the category and the location_id
They are related through a HABTM relationship,
http://guides.rubyonrails.org/association_basics.html#the-has_and_belongs_to_many-association
My question is, how should I add information related to a Location, that
are dipendent on the category?
For example, a Location under the Category "Bar" needs this fields:
"opening_time", "closing_time", "medium_drink_prize" ecc..
A Location under the Category "Hotel" needs this information:
"medium_room_prize", "stars" ecc..
Sometimes the location has 2 categories (has the relationships type self
explained), for examole "Bar", and "Disco", that need both the
Categories field
to be completed.
I think that I should add for every Category a Detail table, that stores
for each field the field's type (file, text, textarea ecc..), and the
name. Category has one Detail, and Detail belongs to Category, but I'm
not sure about.
What would you suggest?
thanks in advance
--
Posted via http://www.ruby-forum.com/.
--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment