TitleIsbnPagesPrice
Kuschewitz, Greschner und Rink11871731866190,00 €
Kirch-Logsch23895195063180,00 €
Weidlich GmbH & Co. KG21845615927540,00 €
Gerbennow GmbH & Co. KG21459444573950,00 €
Schirmer UG6697544501840,00 €
Krämer, Gutjahr und Dörre18205148568630,00 €
Gamper Gruppe1523585398500,00 €
Schlitzer UG31673874729890,00 €
Goldkühle-Winkelmann5346536867280,00 €
Steffny AG3370721399350,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