title: Send_data not sending pdf (WickedPdf)
body: <p>I'm trying to generate a pdf for a user to download. i'm using the WickedPdf gem.</p>
  
  <pre><code>&lt;%= simple_form_for :report, url: [:download, :admin, :reports], format: :pdf, method: :get, remote: true do |f| %&gt;
    &lt;%= f.input :event, collection: @events %&gt; 
    &lt;%= f.input :report_type, collection: [:schedule, :overview] %&gt;
    &lt;%= f.submit "Download" %&gt;
  &lt;% end %&gt;
  
  
  
  class Admin::ReportsController &lt; Admin::BaseController
  
    def index
      @events = Event.all
    end
  
    def download
      respond_to do |format|
        format.pdf do
          pdf = WickedPdf.new.pdf_from_string(pdf_string)
          send_data pdf, :filename =&gt; "report.pdf", :type =&gt; "application/pdf"
        end
      end
    end
  
    private
  
    def pdf_string
      render_to_string(template:'admin/reports/pdf/schedule_overview.html.erb', layout: false)
    end
  
  end
  </code></pre>
  
  <p>app/views/admin/reports/pdf/schedule_overview.html.erb</p>
  
  <pre><code>This is a pdf
  </code></pre>
  
  <p>(just text atm)</p>
  
  <p>Server when request is made:</p>
  
  <pre><code>Started GET "/admin/reports/download?utf8=%E2%9C%93&amp;report%5Bevent%5D=1&amp;report%5Breport_type%5D=schedule&amp;commit=Download" for ::1 at 2017-08-16 16:18:49 +0100
  Processing by Admin::ReportsController#download as JS
    Parameters: {"utf8"=&gt;"✓", "report"=&gt;{"event"=&gt;"1", "report_type"=&gt;"schedule"}, "commit"=&gt;"Download"}
    User Load (0.6ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2  [["id", 1], ["LIMIT", 1]]
    Rendering admin/reports/pdf/schedule_overview.html.erb
    Rendered admin/reports/pdf/schedule_overview.html.erb (0.8ms)
  "***************[\"/Users/jonathansayer/.rvm/gems/ruby-2.4.0/bin/wkhtmltopdf\", \"-q\", \"file:////var/folders/0x/g3xdsy4s48q9y0lpzsppltv80000gn/T/wicked_pdf20170816-33407-4r72d4.html\", \"/var/folders/0x/g3xdsy4s48q9y0lpzsppltv80000gn/T/wicked_pdf_generated_file20170816-33407-1hnp6hr.pdf\"]***************"
    Rendering text template
    Rendered text template (0.1ms)
  Sent data report.pdf (1.9ms)
  Completed 200 OK in 1803ms (Views: 1.4ms | ActiveRecord: 0.6ms))
  </code></pre>
  
  <p>But no pdf is sent to the client. Any help would be greatly appreciated.</p>