RailsCasts Pro episodes are now free!

Learn more or hide this

feiniel's Profile

GitHub User: feiniel

Comments by

Avatar

Hi Ryan,
thanks for this! you talked about how if you don't embed the javascript in the html.erb file (ie have an external js with the graph info instead), you would need to do something else (ajaxy i'm guessing?) could you describe how to do this or point me in the right direction? I'm really new to the js and ajax scene :)

Avatar

Hi Ryan, I was wondering if you could explain the

def self.total_on(date)
  where("date(purchased_at) = ?", date).sum(:total_price)
end

part (like the syntax of the where 'date(purchased_at) = ?', date especially). I get what it's doing and it sounds awesome from such a short line but I tried it in the rails console and it doesn't seem to work for me...