TitleIsbnPagesPrice
Beutelspacher-Janke10055006308080,00 €
Schnürer, Schima und Piesker10407371639630,00 €
Tilgner, Erhardt und Conrad29309396451830,00 €
Wassilew AG30146069029840,00 €
Streit UG15114978008000,00 €
Kahlert-Filipowski1972535412600,00 €
Roggatz, Stoll und Streit100919727610000,00 €
Kirch, Alizadeh und Köseoglu33923279689010,00 €
Einert, Franta und Deja4717972796290,00 €
Prange-Neupert15994857582570,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