TitleIsbnPagesPrice
Bachmann-Eisenlauer7121681378440,00 €
Blockhaus, Marx und Grimm28258683055030,00 €
Weis-Pitschugin33342944595720,00 €
Malucha, Lange und Kedzierski12345866638800,00 €
Dauth AG29323766225680,00 €
Bartels-Geissler10479157507750,00 €
Werrmann-Mikitenko17877486377330,00 €
Jungton-Müller12398336118440,00 €
Bieler-Küter1124750211930,00 €
Hütter, Keiner und Verzi30616647247210,00 €

Download as CSV

HAML:
= table_go_for @books, Book, :table_html => {:class => 'table table-striped table-hover table-bordered'} do |t|
  - t.column :title
  - t.column :isbn
  - t.column :pages
  - t.column :price, :as => :currency
= link_to('Download as CSV', books_path(format: :csv), class: 'btn btn-primary')
Controller:
class BooksController < ApplicationController

  def index
    @books = Book.paginate(pagination_defaults)

    respond_to do |format|
      format.html
      format.csv do
        send_data( render_to_string(:template => 'books/index', :format => :csv),
          :type => 'text/csv; charset=utf-8; header=present',
          :filename => 'books.csv',
          :disposition => 'attachment'
        )
      end
    end
  end

end