TitleIsbnPagesPrice
Balnuweit-Lax32711345246440,00 €
Diekmann AG25842074314170,00 €
Dittmer-Elbe159510092910000,00 €
Walz-Knorr34183748475360,00 €
Hering UG14488849569710,00 €
Deerberg, Koester und Leist31693581625970,00 €
Hassfeld-Fusenig294366329530,00 €
Stöwer OHG3189147088920,00 €
Dörner-Schultze16181783539940,00 €
Weidlich OHG25599532147380,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