I try Prawn and Prawn_to, but i have some problems with generate file .pdf.
I want to create a new page (print.pdf) and pass the data of record through an action like show, delete etc... How can I make this operation? Thanks for all ADC On 23 Giu, 18:54, Soren Christensen <[email protected]> wrote: > Rails is trying to render the template for the function. So you can move > some of the text into the template. > > I would suggest that you also add the parameter :format => "pdf" to the > action link. > > It changes the template naming to be <method>.pdf.erb > > You can also take a look at Prawn and Prawnto. There is a great > railscasts.com episode on those. > > /S > > adc wrote: > > I created an action link with > > > 1. config.action_links.add 'generate_pdf', :label=>"Stampa > > PDF", :type=>:record > > > and i defined > > > def generate_pdf > > pdf = PDF::Writer.new > > pdf.select_font("Helvetica") > > pdf.text("Ciao Ale") > > #pdf.text("Hello Ruby.HTML.it", 72, :justification=>center) > > pdf.save_as("public/example.pdf") > > end > > > The pdf is correct but there is an error > > - ActionController::MissingTemplate (Missing template admin/dmwaters/ > > generate_pdf.html.erb > > > but I would like to bring up the message "PDF Generate ok" like Error > > Message in active scaffold. > > > Thanks for all --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en -~----------~----~----~----~------~----~------~--~---
