[Backgroundrb-devel] Fwd: Render_to_string from a worker

felix clack felixclack at gmail.com
Tue Nov 27 23:40:57 EST 2007


Hi Hemant,

I found the plugin and explanation how to use it at
http://blog.nicksieger.com/articles/2006/05/26/rails-is-simpler-than-office


It registers the extension .rpdf to trigger code in the pdfrender plugin.
I use similar view code to produce a set of addresses for avery labels as in
the example blog post.

I have a controller action that prepares the data for the labels, I use
render_to_string to create and save the pdf based on the view code, and then
send an email with the newly created pdf attached.

This works fine when triggered manually from my app, however I came unstuck
when trying to implement this same process in a worker.

I hope this makes sense. Not sure if this is the best way to do what I'm
trying to achieve but pdfrender was the first solution where I could
understand how it all came together.

Any help on getting this running in a worker would be appreciated.

thanks
Felix

On 25/11/2007, hemant kumar <gethemant at gmail.com > wrote:
>
> You are using render_to_string for generating pdf? You must be using one
> of those groovy plugins i suppose.
>
> Well if, yes... i suppose, it would be available in worker as well...
> But can't say much unless i know, which plugin you are using and
> stuff...
>
>
> On Sun, 2007-11-25 at 12:43 +1100, felix clack wrote:
> > Hi,
> >
> >
> > I am trying to generate a PDF from within a worker using PDF::Writer.
> > In my controller I use render_to_string to create the pdf file however
> > from what I understand render_to_string can only be used from a
> > controller.
> >
> >
> > Does anybody have any suggestions how I might be able to replicate
> > this functionality in a worker?
> >
> > --
> > thanks,
> > Felix
> > _______________________________________________
> > Backgroundrb-devel mailing list
> > Backgroundrb-devel at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/backgroundrb-devel
>
>


-- 
thanks,
Felix

-- 
thanks,
Felix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20071128/ebb24a9b/attachment-0001.html 


More information about the Backgroundrb-devel mailing list