Parent and child category creation


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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs