Chaz Meyers (cpm) wrote,
Chaz Meyers

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. )

  • My tweets

    Tue, 19:54: RT @ TheParkerJam: Suppose you are: * in rails in development mode * using cookies for sessions * raising an exception and not…

  • My tweets

    Mon, 12:48: Well, that was an unexpected turn.

  • My tweets

    Fri, 20:07: I made my first comment on a YouTube video. It got 132 upvotes and 28 comments. The clout is definitely already going to my head.

  • Post a new comment


    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.