[n00b] How to do "direct action" URL => code, no render?

I’m not sure if Rails has this – in other frameworks, it’s called
“direct action” – the idea being that a URL request triggers some code
to run, but doesn’t result in a web-page being displayed.

So, for example, I might have a cron job that does:

wget myApp.domain.com/email_stats

which triggers a notifier to send me email with some database
statistics, but I don’t want it to bother downloading a page.

I could do

wget myApp.domain.com/email_stats > /dev/null

but that strikes me as cleaning up the mess after I make it, rather than
not making the mess in the first place. So what I’m looking for is some
sort of

render => nil

or whatever that I can put at the end of my action to make it not render
a page.

Is that possible?

Thanks!

There has to be some response, or you’ll be violating the HTTP
protocol. However, that can be an empty string.

render :layout => false, :text => “”

that MIGHT work – I have not tried the code. :slight_smile:

–Michael

On 23 Oct 2007, at 17:22, Olie D. wrote:

which triggers a notifier to send me email with some database
sort of

render => nil

render :nothing => true

Fred