TitleIsbnPagesPrice
Brandt-Abramovic8077324736200,00 €
Dück GmbH1684506425200,00 €
Göhler GmbH4252723089960,00 €
Borgschulze Gruppe25869253519040,00 €
Schneider KG1350370568090,00 €
Pflieger KG8533079624060,00 €
Rosksch GmbH & Co. KG25810560362110,00 €
Glatting AG24680190932780,00 €
Aschenbroich, Raubuch und Sujew24929756154850,00 €
Borgschulze, Seigel und Neimke33029884843480,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