TitleIsbnPagesPrice
Kisabaka, Kopf und Ruckdeschel14311928492050,00 €
Grossheim-Schuermann7819837282020,00 €
Kramer-Delonge32429132658200,00 €
Gehrke GmbH18054670168740,00 €
Schwerdtner-Sonn10269741003040,00 €
Rossberg, Poschmann und Malucha4525019899110,00 €
Madubuko AG12159865465960,00 €
Nolte, Mertens und Brauer22130061575080,00 €
Dressler UG56648309210080,00 €
Koehler-Grosser25281674261030,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