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

    Sun, 01:39: RT @ dinoman_j:

  • My tweets

    Mon, 00:15: In a randoms Among Us discord, people were going "POGGERS" and I ask, "Hey, are any of you old enough to remember the game "pogs"…

  • My tweets

    Sun, 11:55: RT @ computerfact: everyone thinks theyre the plumber but in reality we're all just turtles minding our own business waiting to be…

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