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,
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
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