How to download Prawn pdf while using form submit?

submit.pdf.prawn files
pdf.text "successfully submitted"

form controller file
def index
    @forms = Form.all
    respond_to do |format|
      format.html
    end
  end
  def submit
    respond_to do |format|
    format.pdf {render }

  end
  end