Hello. I'm creating a very simple timeshare application using Sinatra and Datamapper. Every user in the application will have n reservations and for the time being each reservation runs from Monday to Sunday and there can only be one reservation per week.
Now I will need a view with a textbox (and label) for each week of the year where the users will put their name (through autocompletion or something) and thereby creating a reservation for that week. And if the week is reserved the name will of course be filled in the textbox (and disabled)
It would be something like
weeks.each do
find user that has reserved this week - and create a textbox
end
So my question I guess is as simple - how do I loop through all weeks of a year in Ruby?
Or would it be a better solution to just loop 52 times and make an array for each user with the numbers of reserved weeks in it?