TitleIsbnPagesPrice
Göbel, Hackelbusch und Krieger25937784299280,00 €
Sladek, Pfersich und Dieckmann22400046114770,00 €
Fahner Gruppe28140120904130,00 €
Schwarz-Rosenbauer20737904115340,00 €
Agostini, Plank und Schelk1012042154520,00 €
Ruch Gruppe3229540635200,00 €
Danner-Brenner12246496807070,00 €
Weber, Kappler und Ahrenberg15782879164120,00 €
Streck-Grosser5442475216090,00 €
Spitzmüller OHG16078081871550,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