TitleIsbnPagesPrice
Bork-Kirst6622474724270,00 €
Koleiski Gruppe4062155895810,00 €
Cornelsen, Poser und Volkmann11580573548890,00 €
Ade-Schorr8035477394030,00 €
Gunther, Daudrich und Frosch4889446212360,00 €
Fenske KG34067891814800,00 €
Gabius-Franke7694204131390,00 €
Amann-Harnapp23099953713420,00 €
Vona-Scheytt28996476781980,00 €
Volker Gruppe19204929062700,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