Thanks, I'll try that.

I got to here myself, but it's not right ! I think it's close though and 
I find this syntax easier to read.

def availability

  @bookings = Booking.find(:all)

  for booking in @bookings do
    bookingfirstday = booking.from.to_date
    bookinglastday = booking.to.to_date
    @BookedDays = (bookingfirstday..bookinglastday).map
  end

end

Can you explain why it's wrong ?

The result is that I @BookedDays only gets set to the last evaluated 
booking (I think).

I will try your way though, thanks. (I'd like to get my way working also 
if poss)?

Is the loop rewriting @BookedDays each time around rather than adding to 
it?

ta

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to