What is the best method in Rails to create a self-reported category?

Asked

Viewed 135 times

0

I would like a hint to create a self-referenced category where it would be possible to add daughter categories of her own and so susceptibly for the purpose of building a tree using the same object.

Is there any Gem or an easy and well optimized way to do this?

  • 2

    Hello. If you’ll allow me a hint, your question (and especially her title) seems a little subjective and prone to receiving opinions as an answer. This type of question is not desired here (take a look at this link: http://answall.com/help). It may be interesting to edit it (if possible, including attempts you have already made to create such a category) to make the question more specific. :)

  • I didn’t know that I was obliged to have code on the page nor that no one can ask for suggestions but thanks!!! I liked the reply from @Cassiocabral

  • It’s not a question of forcing or stopping. I really think your question is interesting for the community, but I just suggested that you try to make it a little better. The objectivity aspect is important in this community as well as in the entire Stackexchange group. When you have time read this (http://meta.pt.stackoverflow.com/questions/486/good-subjective-bad-subjective) and this (http://meta.pt.stackoverflow.com/questions/57/devemos-aceitar-questoes-de-recomendacao/160) thread. Anyway, I didn’t want to tolerate your participation, okay? :)

1 answer

2


You can see this Gem ancestry

How you want a model that self-references, more specifically for category and since it is to build a tree. The Gem ancestry has already been made for this kind of case.

  • Great! + 1 (I will remove my first comment)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.