def index
@forms = Form.all
respond_to do |format|
format.html
end
end
def submit
respond_to do |format|
format.pdf {render }
end
end
submit.pdf.prawn file
pdf.text "successfully submitted"
views:
26answers:
1
A:
Use prawn to generate a pdf that's saved somewhere in your /public folder, like:
Prawn::Document.generate("#{RAILS_ROOT}/public/pdfs/myfile.pdf")
Then just use your controller to redirect users to that location:
redirect_to '/pdfs/myfile.pdf'
go minimal
2010-09-30 17:51:41
Use prawn to generate a pdf that's saved somewhere in your /public folder, like:Prawn::Document.generate("#{RAILS_ROOT}/public/pdfs/myfile.pdf")Then just use your controller to redirect users to that location:redirect_to '/pdfs/myfile.pdf'
zealmurugan
2010-10-04 05:33:12
Use prawn to generate a pdf that's saved somewhere in your /public folder, like:Prawn::Document.generate("#{RAILS_ROOT}/public/pdfs/myfile.pdf")Then just use your controller to redirect users to that location:redirect_to '/pdfs/myfile.pdf'
zealmurugan
2010-10-04 05:33:13
Use prawn to generate a pdf that's saved somewhere in your /public folder, like:Prawn::Document.generate("#{RAILS_ROOT}/public/pdfs/myfile.pdf")Then just use your controller to redirect users to that location:redirect_to '/pdfs/myfile.pdf'
zealmurugan
2010-10-04 05:33:13
Unknown actionNo action responded to show. Actions: current_user, current_user_session, generate, index, permission_denied, travel_log, and unauthorised_url
zealmurugan
2010-10-04 05:34:04