title: pdfkit does not style pdfs
body: <p>I have a rails 3.1 app that creates pdf documents using pdfkit, and everything works as specified, except for the fact that the generated pdfs don't have any styling. I am assuming that wkhtmltopdf doesn't have access to my stylesheets and that it is not a larger issue than that. Would anyone have a clue as to how you would allow access to these stylesheets? I have basically followed railscast #220 on the subject, however I have had to create a new initializer to get pdfkit to work with rails 3.1. </p>
  
  <p>This is the initializer that I had to use to get pdfkit to work with rails 3.1</p>
  
  <pre><code>ActionController::Base.asset_host = Proc.new { |source, request|
    if request.env["REQUEST_PATH"].include? ".pdf"
      "file://#{Rails.root.join('public')}"
    else
      "#{request.protocol}#{request.host_with_port}"
    end
   } 
  </code></pre>
  
  <p>The link to the pdf looks like this: </p>
  
  <pre><code>&lt;%= link_to 'Download PDF', load_path(@load, :format =&gt; "pdf") %&gt;
  </code></pre>
  
  <p>This will give me a link to the pdf that has no styling.</p>
  
  <p>In my application.rb I have configured pdfkit as such:</p>
  
  <pre><code>config.middleware.use PDFKit::Middleware, :print_media_type =&gt; true
  </code></pre>
  
  <p>I have also added this to my layouts/application.html.erb file:</p>
  
  <pre><code>&lt;%= stylesheet_link_tag    "application", :media =&gt; "all" %&gt;
  </code></pre>