ruby on rails - How do i download prawn pdf file while using form submit? -


def index     @forms = form.all     respond_to |format|       format.html     end   end     def submit         respond_to |format|         format.pdf {render  }      end     end  submit.pdf.prawn file pdf.text "successfully submitted" 

it possible prawn generate , return pdf without having to save locally...

def submit   send_data(generate_pdf, :filename => "output.pdf", :type => "application/pdf")  end  private  def generate_pdf     prawn::document.new         text "hello stackoverflow"     end.render  end 

Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -