Chaz Meyers (cpm) wrote,
Chaz Meyers
cpm

Decoupled URL Writers is Rails! Huzzah!

What's New in Edge Rails: Build URLs in Your ActionMailers (and other non-controllers)

I don't normally do the link-blurb-comment typical blog style posts, but this news had me so excited when I read about it last week. For the past few weeks, I've been thinking about tucking my mailing code into observers rather than calling them directly from my controllers. The problem with that is that half of the stuff I mail out have URLs to various pages within the application. Up until now, the URL generation code has been tightly coupled to the controller classes, so making URLs from non-controller contexts was not possible. The choices were either to hardcode URLs, create your own parallel URL generator, or pass URLs or controllers directly to the mailer. Gross.

I can't wait until this moves out of Edge and into the stable rails distribution. :)

( Meh. Not like more than 2 or 3 people who use Rails even read this. :-P No one to share in my joy makes me sad. )
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 2 comments