TitleIsbnPagesPrice
Huke-Mensing5449453623720,00 €
Kutzner, Naumann und Pajonk29379858644170,00 €
Bock, Steding und Neumann18983616022260,00 €
Überacker UG15969366287690,00 €
Hess, Hodea und Bichler10431789666490,00 €
Sokolowski, Keutel und Ripken15303108401270,00 €
Eich AG30877324729710,00 €
Bickel, Agostini und Vahlensieck3318000135670,00 €
Ullrich KG4768796965720,00 €
Tschirch-Grasse4268426396970,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