title: Can generate xlsx file using axlsx_rails but can't download file when done via POST
body: <p>I'm using <strong>axlsx</strong> (with <strong>axlsx_rails</strong> for templating).</p>
  
  <p>I have this in my controller:</p>
  
  <pre><code>  def listado_publicaciones
      if params[:publicaciones]
        @Publicaciones = params[:publicaciones]
      else
        @Publicaciones = Proyecto.where("concurso_id","=",@concurso.id).as_json({:include =&gt; [:creador =&gt; {:only =&gt;[:id],:include =&gt;[:ficha =&gt;{:only =&gt;[:nombres,:apellidos], :methods =&gt; [:fullname],:include =&gt; [:publicacions =&gt; {:only =&gt;[:id,:omitir,:anio,:titulo,:revista_nombre,:primer_autor,:autor_correspondiente,:coautor,:estado_id],:include =&gt; [:subtipo]}]}]}]})
      end
      respond_to do |format|
        format.html
        format.json { render :json =&gt; @Publicaciones}
        format.xlsx
      end
    end
  </code></pre>
  
  <p>(I will use JBuilder later to avoid the long @Publicaciones...)</p>
  
  <p>Well, "listado_publicaciones" first shows an html view, where using angular, gets a json list of publications, and there is where the user can discard some items before generating the excel..
  The user then clicks a button "To Excel" that calls an angularjs service:</p>
  
  <pre><code>@project.service 'concursos_xlsx', [
    '$resource'
    ($resource) -&gt;
      $resource '/concursos/:id/:action.xlsx', { id: '@id' },
        listado_publicaciones:
          method: 'POST'
          params: action: 'listado_publicaciones'
  ] 
  </code></pre>
  
  <p>I use POST, because I send back a $scope with the publications I first got on a Json, this is a very large list of publications and some other data, so if I try to use GET won't work because of the long url...</p>
  
  <p>Then, the same controller, "listado_publicaciones" gets the parameter publicaciones (params[:publicaciones]) and responds to format xlsx...</p>
  
  <p>Then, my template called "listado_publicaciones.xlsx.axlsx" generates the excel file.... BUT I don't know <strong>how to download it</strong>...
  If I check the chrome developers tool, I can see this:</p>
  
  <pre><code>XHR finished loading: POST "http://localhost:3000/concursos/1/listado_publicaciones.xlsx".
  </code></pre>
  
  <p>And if I double click there, I can actually download the xlsx file... but I just don't know how to get the file downloaded when clicking the "To Excel" button...
  I've tried using "<strong>send_data</strong>", "<strong>send_file</strong>", but maybe I'm using them the wrong way...
  Please help, thanks!</p>