Markus Svennerstål
2008-Feb-07 09:15 UTC
Problems when calling rendering a template from a cron job
Hi,
I am trying to use a cron job to render and mail pdf files on a daily
basis. Problem is that this code doesn''t compile and render the
template; it just passes the embedded ruby code on as text.
app = ActionView::Base.new
app.controller = ActionController::Base.new
data = app.render_template(''rhtml'',
"path_to_template/template.rhtml")
pdf << data
Reason that I use render_template is that render_to_string, which I
originally used, is a protected method... and if I try to bypass that
with send, I get a null pointer exception.
Cheers
/Markus
--
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
-~----------~----~----~----~------~----~------~--~---