Being new to Rails, I would appreciate some help defining some database
table relationships. I have the following tables:
waypoints
id
name
routes
id
name
routepoints
route_id
waypoint_id
seqno
This leads to the Rails associations:
waypoints
has_and_belongs_to_many :routes, :join_table => "routepoints"
routes
has_and_belongs_to_many :waypoints, :join_table => "routepoints"
My problem is that routepoints defines an ordered list of waypoints for
a given route (using "seqno"). Is it possible to use acts_as_list
somehow? I will also need other attributes of routepoints (like
estimated time enroute, fuel burn, etc.).
Any ideas appreciated!
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---
ewo wrote:> Being new to Rails, I would appreciate some help defining some database > table relationships. I have the following tables: > ... > My problem is that routepoints defines an ordered list of waypoints for > a given route (using "seqno"). Is it possible to use acts_as_list > somehow? I will also need other attributes of routepoints (like > estimated time enroute, fuel burn, etc.).You''ll want to use has_many :through associations and a join model. Read the API docs, read the wiki, read my blog. http://blog.hasmanythrough.com/articles/2006/04/20/many-to-many-dance-off -- Josh Susser http://blog.hasmanythrough.com -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Thanks, Josh. Exactly what I needed... --Eric --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---