Class: ActionController::Responder
- Inherits:
-
Object
- Object
- ActionController::Responder
- Defined in:
- lib/cloudxls-rails/handlers/xlsx.rb,
lib/cloudxls-rails/handlers/xls.rb,
lib/cloudxls-rails/handlers/csv.rb
Overview
For respond_to default
Instance Method Summary collapse
Instance Method Details
#to_csv ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/cloudxls-rails/handlers/csv.rb', line 49 def to_csv if [:stream] == true CloudXLSRails::CSVResponder.stream!(controller, resources.last, ) else controller.render({:csv => resources.last, :stream => false }.merge()) end end |
#to_xls ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/cloudxls-rails/handlers/xls.rb', line 30 def to_xls stream = .delete(:stream) || false if stream # either string or boolean [:data] ||= {} [:data][:url] ||= cloudxls_stream_url(stream, 'xls') end CloudXLSRails::XLSResponder.redirect!(controller, resources.last, ) end |
#to_xlsx ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/cloudxls-rails/handlers/xlsx.rb', line 31 def to_xlsx stream = .delete(:stream) || false if stream # either string or boolean [:data] ||= {} [:data][:url] ||= cloudxls_stream_url(stream, 'xlsx') end CloudXLSRails::XLSXResponder.redirect!(controller, resources.last, ) end |