Module: RenderAsCSV::InstanceMethods
- Defined in:
- lib/comma.rb
Instance Method Summary collapse
Instance Method Details
#render_with_csv(options = nil, extra_options = {}, &block) ⇒ Object
57 58 59 60 61 62 |
# File 'lib/comma.rb', line 57 def render_with_csv( = nil, = {}, &block) return render_without_csv(, , &block) unless .is_a?(Hash) and [:csv] data = .delete(:csv) style = .delete(:style) || :default send_data Array(data).to_comma(style), .merge(:type => :csv) end |