Order of rooms

Hi,

Ive got one trouble. Ive 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.room(id = 1) 2. room (id = 2) 3. room (id = 3) I will take first
room, but after that I would like to have:
2.room (id = 2) 3.room (id = 2) 1.room (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

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.

Thank you,

I will try it.

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