Module: RenderAsCSV::InstanceMethods
- Defined in:
- lib/comma.rb
Instance Method Summary collapse
Instance Method Details
#render_with_csv(options = nil, extra_options = {}, &block) ⇒ Object
44 45 46 47 48 49 |
# File 'lib/comma.rb', line 44 def render_with_csv( = nil, = {}, &block) return render_without_csv(, , &block) unless (.respond_to? '[]') and [:csv] data = .delete(:csv) style = .delete(:style) || :default send_data Array(data).to_comma(style), .merge(:type => :csv) end |