title: wicked_pdf on Rails 4 not generating pdf
body: <p>My set up : Rails 4.1.1 and ruby 2.1.1p76 locally on MacOS X 10.10.1 and prod on Heroku.</p>
  
  <p>I installed <code>gem 'wicked_pdf'</code>and <code>gem 'wkhtmltopdf-binary'</code></p>
  
  <p>In <code>config/initializers/mime_types.rb</code>, I added :</p>
  
  <pre><code>Mime::Type.register "application/pdf", :pdf
  </code></pre>
  
  <p>In <code>config/initializers/wicked_pdf.rb</code>, I tried both :   </p>
  
  <pre><code> :exe_path =&gt; '/usr/local/bin/wkhtmltopdf'
  </code></pre>
  
  <p>and</p>
  
  <pre><code>:exe_path =&gt; '#{Rails.root}/bin/wkhtmltopdf'
  </code></pre>
  
  <p>When I run in Terminal</p>
  
  <pre><code>$ wkhtmltopdf http://google.com google.pdf
  </code></pre>
  
  <p>from my app directory, it does generate a pdf file. So I assume wkhtmltopdf is set up properly.</p>
  
  <p>My <code>object_controller.erb</code> contains :</p>
  
  <pre><code>def print_view
    @teams = [Team.find(params[:team_id])]
    respond_to do |format|
      format.html
      format.pdf do
        render :pdf         =&gt; "file_name",
               :layout      =&gt; "/layouts/print_layout.html.erb"
      end
    end
  end
  </code></pre>
  
  <p>My <code>views/layouts/print_layout.html.erb</code> (shorten for clarity) :</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
    &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;%= wicked_pdf_stylesheet_link_tag('print', :media =&gt; :print) %&gt;
    &lt;/head&gt;
    &lt;body class="&lt;%= controller_name %&gt; &lt;%= action_name%&gt;"&gt;
      &lt;%= yield %&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And my <code>views/object/print_view.html.erb</code>  (shorten for clarity) :</p>
  
  <pre><code>&lt;div id="schedule-tables"&gt;
      &lt;%= render 'weekview_print' %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I have 2 problems :</p>
  
  <ol>
  <li>I get a html page, not a pdf</li>
  <li>the page is using the default layout, not the specified layout</li>
  </ol>