ruby - Spit out a list of the last 10 days in Rails 3 -
i feel should qualify of questions saying brand new rails 3, forgive me newbiness. i've been reading actionview date helpers, cannot figure out how complete simple function. in rails 3, want spit out html list last 10 days. so, instance, today:
<li>tuesday, february 8</li> <li>monday, february 7</li> <li>sunday, february 6</li> <li>saturday, february 5</li> <li>friday, february 4</li> <li>thursday, february 3</li> <li>wednesday, february 2</li> <li>tuesday, february 1</li> <li>monday, january 31</li> <li>sunday, january 30</li>
it seems simple, cannot figure out. care give shot?
<%- date.today.downto(date.today - 9.days) |date| %> <li><%= date %></li> <%- end %>
Comments
Post a Comment