# Children sorting

**URL:** <https://www.ruby-forum.com/t/children-sorting/104421>\
**Category:** Radiant CMS\
**Created:** [May 17, 2007, 7:50pm UTC](https://www.ruby-forum.com/t/children-sorting/104421 "2007-05-17T19:50:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Minor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b38774/32.png) [@David\_Minor](https://www.ruby-forum.com/u/David_Minor)\
**Post date:** [May 17, 2007, 7:50pm UTC](https://www.ruby-forum.com/t/children-sorting/104421/1 "2007-05-17T19:50:29Z")

</div>

Here’s the code I’m using. I’m pretty confident this was radiant  
created code during setup:

\<r:children:each limit=“5” order=“desc”\>

### 

more…

changing to order=“asc” does not change the ordering of the  
children. what am I missing?

---

<div class="post-metadata">

**Author:** ![David\_Minor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b38774/32.png) [@David\_Minor](https://www.ruby-forum.com/u/David_Minor)\
**Post date:** [May 17, 2007, 9:26pm UTC](https://www.ruby-forum.com/t/children-sorting/104421/2 "2007-05-17T21:26:23Z")

</div>

what I needed was to specify the by=“attribute” to set the children  
to sort by the created\_at date.

it eventually hit me.

dm

---

<div class="post-metadata">

**Author:** ![David\_Minor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b38774/32.png) [@David\_Minor](https://www.ruby-forum.com/u/David_Minor)\
**Post date:** [May 18, 2007, 3:06am UTC](https://www.ruby-forum.com/t/children-sorting/104421/3 "2007-05-18T03:06:59Z")

</div>

Yes, the default is published\_at.

Sean
