title: Two Export buttons to CSV in Rails
body: <p>I'm new to Ruby, I need to add a new button that export different attributes to csv.The old button exports all attributes of the collection.
  I have this line in controller:</p>
  
  <pre><code>  respond_to :csv, only: :index
  </code></pre>
  
  <p>I have this in the html view:</p>
  
  <pre><code> = link_to collection_path(format: :csv), tabindex: '-1'
            = fa_icon 'file-code-o', text: 'CSV', class: 'fa-fw'
  </code></pre>
  
  <p>and I have a file called <code>index.csv.slim</code>, its content:</p>
  
  <pre><code>= collection.to_csv
  </code></pre>
  
  <p>I have the <code>to_csv</code> method defined and it responds automatically to the export!
  <code>http://localhost/records.csv</code></p>
  
  <p>How can I add a new button that responds to different method, should I add another file like <code>index.csv.slim</code>? how can I link them together ?
  Or at least if I can pass a parameter to the <code>to_csv</code> ?
  and :</p>
  
  <pre><code>= collection.to_csv(all)
  </code></pre>
  
  <p>and :</p>
  
  <pre><code>  def to_csv (all = true)
  </code></pre>
  
  <p>Note: we're using <code>inherited resources</code> and <code>Draper</code> gems.
  so I don't have actions in controllers. 
  and nothing there in routes file.</p>
  
  <p>Note: using this <a href="http://railscasts.com/episodes/362-exporting-csv-and-excel" rel="nofollow">way</a></p>