neilbradley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Nov-24 14:13 UTC
Parent and child category creation
Hello, I am currently creating an online store in RoR. For the administration screens, I want to be able to allow new Parent categories and Child categories to be created or deleted but I am a little unsure of how to do this. What I would also like to happen is for the menu of the online store to update - based on the parent and child categories created in the admin system, and then obviously to add products into these categories. I wondered if anyone has produced a similar solution and mgiht be able to share or advise of how I can proceed? Thank you. --~--~---------~--~----~------------~-------~--~----~ 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
you''ll want a pages table/model that includes the column parent_id then in your model use acts_as :tree and you now have access to page.parent and page.children relation ships -- Posted via 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 groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---