Forum: Ruby on Rails Order of rooms

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Janka (Guest)
on 2008-11-10 11:01
(Received via mailing list)

I`ve got one trouble. I`ve got order of rooms(order by id), but I`m
choosing available one, after that I would like to send the room,
which was taken on the last place. Something like this I have: = 1) 2. room (id = 2) 3. room (id = 3) I will take first
room, but after that I would like to have: (id = 2) (id = 2) (id = 3), it doesn`t have to be
id it might be rank or something like that.

I would appreciate if you could help.

Thank you Janka
Ar C. (Guest)
on 2008-11-10 14:45
If you stick your rooms into an array, just pick out whichever room is
selected, and push that room back onto the tail of the array.
Jana Bohmova (Guest)
on 2008-11-10 15:14
(Received via mailing list)
Thank you,

I will try it.
This topic is locked and can not be replied to.