Ruby

http://s.erious.ly

Posts tagged "actionmailer"

April 21, 2010: Annnndd… We’re live

Top Story What else, but the actual live sale page for Rails Test Prescriptions, which is http://www.pragprog.com/titles/nrtest/rails-test-prescriptions. You should be able to see the cover off to the right sidebar. (As I write this, they haven’t turned on the “Buy” link, sometime today, I think). I like the mortar and pestle in the cover, it...

Sending email: Controllers versus Models

While reviewing some code recently, I came across controller code that resembled the following.

if @customer.save
  CustomerMailer.deliver_welcome_message(@customer)
  flash[:message] = "Your account has been successfully created. We've sent you a welcome letter with..."
  redirect_to dashboard_path
else
  ...
end

Fairly typical Rails code. Nothing alarming here, but I wanted to evaluate the call to the mailer in...