?

Log in

No account? Create an account
Decoupled URL Writers is Rails! Huzzah! - Chaz Meyers [entries|archive|friends|userinfo]
Chaz Meyers

[ website | chazmeyers.com ]
[ profile | view profile ]
[ archive | view archive ]

Links
[Links:| chazmeyers.com Twitter ]

Decoupled URL Writers is Rails! Huzzah! [Aug. 31st, 2006|08:42 am]
Chaz Meyers
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. )
LinkReply

Comments:
[User Picture]From: revjim
2006-09-05 09:06 pm (UTC)
Wooo. I haven't used Rails since I determined that it was too unstable and too resource intensive for me to use on a shared server. However, I do remember that this facet REALLY annoyed me. Glad to see they are moving it to a more appropriate place.
(Reply) (Thread)
[User Picture]From: cpm
2006-09-05 10:08 pm (UTC)
Yeah. I would certainly not recommend rails for shared hosting.

Were you using mod_fastcgi and Apache? That seems to be the standard for shared hosting, and it also seems to be one of the worst combinations available. :( I think the current recommendation is to use Apache2 to proxy requests to mongrel processes. Fortunately, my application is running well enough for now with Apache+FastCGI on a dedicated box, but I fear for the future.

(Reply) (Parent) (Thread)