bingo bob wrote:
> How do I display twelve of em...I know this is uber easy but I can't get
> it to work.
>
> I firgure something like what follows is useful but I cant get the loop
> within the loop working in the view.
>
> <%
> start = Time.now.month
> finish = Time.now.month + 12
> %>
Yeah, that's not going to work. The easiest way is probably something
like this:
<% d = Date.today %>
<% 12.times do %>
<%= calendar(:year => d.year, :month => d.month) do |d|
if @BookedDays.include?(d)
[d.mday, {:class => "specialDay"}]
else
[d.mday, {:class => "normalDay"}]
end
end
%>
<% d >>= 1 # advance 1 month %>
<% end %>
--
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
-~----------~----~----~----~------~----~------~--~---