On 17 March 2010 23:05, Kendall Gifford <[email protected]> wrote: > Anyhow, if anyone also has any other good recommendations on how to > keep controllers DRY when you need to do something like what I'm > trying to do here, feel free to chime in.
I had a similar problem several weeks ago; I have lots of Prawnto views and I needed to render one outside of the ERB (to generate a PDF for an email file attachment). In the end, I wrote some wholly ugly code to get around it: http://www.workingwithrails.com/forums/4-ask-a-rails-expert/topics/804-send-dynamicly-generated-pdf-as-attachement http://groups.google.com/group/prawn-ruby/browse_thread/thread/1859774668fc66a2 ... my solution was certainly frowned on by the Prawn core; and they're correct. It does seem that Prawnto causes more problems than it solves by trying to be "nice". If you follow the Prawn guides for integrating with Rails, the process is a lot more re-useable. But if you're in my position, and are stuck with loads of Prawnto views you can't get rid of overnight, then the solution I've posted will at least let you take their output and put it to different use. -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

