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! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Graff
2007-Oct-23 16:32 UTC
Re: [n00b] How to do "direct action" URL => code, no render?
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. :) --Michael --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2007-Oct-23 18:52 UTC
Re: [n00b] How to do "direct action" URL => code, no render?
On 23 Oct 2007, at 17:22, Olie D. wrote:> > 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 => nilrender :nothing => true Fred