On Wednesday, July 18, 2012 12:56:29 PM UTC+1, Wijnand wrote: > > This is my first week of Ruby and ROR and new to this discussiongroup. > > I build a pdf generator with prawn. Currently I run it from a run.rb file > that contains: > [snip] > >> Now I have no idea, how to execute that file when I press on my generate >> button in my rails app: >> > >> My apologies if this is the wrong place to ask my question, but I have > been lost at this for 2 days now and I don't know how to find the answer on > Google :/ >
I'd use something like prawn-rails to write your pdf generation code as a view. As would any other view your controller would setup any data you need and then the view file itself contains the layout info. You could even use the usual respond_to stuff so that going to the url with .html at the end gets you the html version but changing the suffix to .pdf would get you the pdf version. Fred -- 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]. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/_mu1bkRiW8wJ. For more options, visit https://groups.google.com/groups/opt_out.

