Browse files

Fix formats

  • Loading branch information...
1 parent 6fb9bf9 commit 89ec76db1c80b3ef571b77e306f13e2c952afb26 @glebm committed Dec 5, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/to_spreadsheet/rails/action_pack_renderers.rb
View
2 lib/to_spreadsheet/rails/action_pack_renderers.rb
@@ -7,7 +7,7 @@
ActionController::Renderers.add :xlsx do |template, options|
filename = options[:filename] || options[:template] || 'data'
data = ToSpreadsheet::Context.with_context ToSpreadsheet::Context.global.merge(ToSpreadsheet::Context.new) do |context|
- html = render_to_string(template, options.merge(template: template.to_s, formats: ['html']))
+ html = render_to_string(template, options.merge(template: template.to_s, formats: ['xlsx', 'html']))
ToSpreadsheet::Renderer.to_data(html, context)
end
send_data data, type: :xlsx, disposition: %(attachment; filename="#{filename}.xlsx")

0 comments on commit 89ec76d

Please sign in to comment.