views:

26

answers:

1
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"
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
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
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
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
Unknown actionNo action responded to show. Actions: current_user, current_user_session, generate, index, permission_denied, travel_log, and unauthorised_url
zealmurugan