Sha256: 6d0de8cc80bccd47266f3f779683f32fd93ff22c7006efde376c74a847a96e84
Contents?: true
Size: 567 Bytes
Versions: 4
Compression:
Stored size: 567 Bytes
Contents
class PostsController < ApplicationController respond_to :csv, :xls, :xlsx, :html def index respond_with(Post.all, :columns => export_attributes) end def stream respond_with(Post.all, :stream => true, :columns => export_attributes) end # Used for stub/mocking a redirect request def successful_redirect # make rails 3.1 happy with a template # /views/posts/successful_redirect.html.erb render :text => "OK" end protected def export_attributes %w[title visits conversion_rate published_on published expired_at] end end
Version data entries
4 entries across 4 versions & 1 rubygems