Displaying 2 results from an estimated 2 matches for "at_beginning_of_month".
2009 Mar 04
10
total per user
...$3000 Feb $4000 March $1500, etc. I can get this to work
if I sum totals (aggregate of all users) but just not by user.
Here is my code in the controller:
def index
@users = User.find :all, :order => ''name ASC''
@deal_groups = Deal.find(:all).group_by {|t|
t.saledate.at_beginning_of_month}
end
And then the code in the View
<% for user in @users %>
<ul id="monthly-revs">
<strong><li><%=h Time.now.year %></li></strong>
<% user.deal_groups.keys.sort.each do |month| %>
<li><%=h month.strftime(''%B'&...
2006 Jul 28
4
add one month or one year to a date
Hi,
I need to be able to add one month or in some cases on eyear to a Date.
Does anyone know of any easy ways of doing this?
thanks
scott
--
Posted via http://www.ruby-forum.com/.