# Categories and articles plug-in, act\_as\_tree, act\_as\_list

**URL:** <https://www.ruby-forum.com/t/categories-and-articles-plug-in-act-as-tree-act-as-list/176149>\
**Category:** Rails\
**Created:** [September 25, 2009, 10:20am UTC](https://www.ruby-forum.com/t/categories-and-articles-plug-in-act-as-tree-act-as-list/176149 "2009-09-25T10:20:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rtacconi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/13edae/32.png) [@rtacconi](https://www.ruby-forum.com/u/rtacconi)\
**Post date:** [September 25, 2009, 10:20am UTC](https://www.ruby-forum.com/t/categories-and-articles-plug-in-act-as-tree-act-as-list/176149/1 "2009-09-25T10:20:39Z")

</div>

This is my first message, so hello to everybody!

I would like to have a simple intranet with categories and articles  
management. I think to use act\_as\_tree for the categories and  
act\_as\_list for the articles, but any article should be connected to  
one category. So in any category I can have one or more articles in a  
list. Do I have to declare a Category class as parent of the list of  
the articles? As you might guess I am a Ruby and Rails rookie.

I would like to know if there is a plug-in with this features, where I  
can manage categories and articles.

Regards,

Riccardo.

---

<div class="post-metadata">

**Author:** ![rtacconi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/13edae/32.png) [@rtacconi](https://www.ruby-forum.com/u/rtacconi)\
**Post date:** [September 25, 2009, 10:47am UTC](https://www.ruby-forum.com/t/categories-and-articles-plug-in-act-as-tree-act-as-list/176149/2 "2009-09-25T10:47:00Z")

</div>

2009/9/25 rtacconi [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I would like to know if there is a plug-in with this features, where I  
> can manage categories and articles.

Apologies if you have already done this but I recommend newcommers to  
look at the rails guides at [http://guides.rubyonrails.org/](http://guides.rubyonrails.org/)  
particularly Getting Started and ActiveRecord Associations. These may  
answer some of your questions.

Are you sure you need a _list_ of articles as opposed to just a  
collection of them such as would be provided by the normal has\_many,  
belongs\_to relationship?

Colin

---

<div class="post-metadata">

**Author:** ![rtacconi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/13edae/32.png) [@rtacconi](https://www.ruby-forum.com/u/rtacconi)\
**Post date:** [September 25, 2009, 3:02pm UTC](https://www.ruby-forum.com/t/categories-and-articles-plug-in-act-as-tree-act-as-list/176149/3 "2009-09-25T15:02:49Z")

</div>

2009/9/25 rtacconi [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> > > I would like to have a simple intranet with categories and articles  
> > > look at the rails guides athttp://guides.rubyonrails.org/  
> > > the articles display. Showing the articles using act\_as\_list is  
> > > perfect, since I want to show the articles as and ordered list.

If the articles have a definite intrinsic sequence that is not  
determined by date or other property of the article then acts\_as\_list  
may indeed be appropriate. Note that acts\_as\_list is about how the  
data is stored in the database rather than just an order of viewing at  
some instant.

Colin

---

<div class="post-metadata">

**Author:** ![rtacconi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/13edae/32.png) [@rtacconi](https://www.ruby-forum.com/u/rtacconi)\
**Post date:** [September 25, 2009, 1:35pm UTC](https://www.ruby-forum.com/t/categories-and-articles-plug-in-act-as-tree-act-as-list/176149/4 "2009-09-25T13:35:00Z")

</div>

Thanks for your help.

On Sep 25, 9:44 am, Colin L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > list. Do I have to declare a Category class as parent of the list of  
> > the articles? As you might guess I am a Ruby and Rails rookie.
> 
> > I would like to know if there is a plug-in with this features, where I  
> > can manage categories and articles.
> 
> Apologies if you have already done this but I recommend newcommers to  
> look at the rails guides athttp://guides.rubyonrails.org/  
> particularly Getting Started and ActiveRecord Associations. These may  
> answer some of your questions.

I had a look and I wll start soon to read migrations and ActiveRecord  
chapters in “Agile Web D. in Rails”

> Are you sure you need a _list_ of articles as opposed to just a  
> collection of them such as would be provided by the normal has\_many,  
> belongs\_to relationship?

Let’s say you have some articles and the administrator wants to order  
the articles display. Showing the articles using act\_as\_list is  
perfect, since I want to show the articles as and ordered list.
