title: How do I download a pdf document from html in rails for a custom path?
body: <p>I am trying to figure out how to download a pdf document from the standard html template. 
  I am using wicked pdf gem to generate the PDF.</p>
  
  <p>I followed the instructions in <code>bundle install</code> and set up the config according to
  <a href="https://github.com/mileszs/wicked_pdf" rel="nofollow">https://github.com/mileszs/wicked_pdf</a></p>
  
  <p>following this, I am trying to make it work for a custom route. It keeps rendering <code>HTML</code> instead of delivering <code>PDF</code> as specified in the form</p>
  
  <p>What am i doing wrong? Is there a better way to route it to the pdf download?</p>
  
  <p>config/routes.rb</p>
  
  <pre><code>  match "/profile" =&gt; "vacancies#profile", via: :get
  </code></pre>
  
  <p>view</p>
  
  <pre><code>&lt;%= form_for(@vacancy, :url =&gt; profile_path, :html =&gt; {:method =&gt; :get, :format =&gt; 'pdf'}) do |f| %&gt;
    &lt;%= submit_tag "Export Profile"%&gt;
  &lt;%end%&gt;
  </code></pre>
  
  <p>vacancies_controller</p>
  
  <pre><code>def profile
    respond_to do |format|
       format.html{
         render :layout =&gt; false
       }
       format.pdf do
         render :pdf =&gt; "temp"
         render :layout =&gt; false
       end
    end
  end
  </code></pre>