Skip to content
asanghi edited this page Mar 13, 2011 · 1 revision

If you're getting an error on using this gem on Heroku with the new :template_path functionality, the solution is to convert the Read Only Excel template into a StringIO which can be written to.

template_string = StringIO.new(File.open('/path/to/your/template.xls'){|x|x.read})
excel_rails(:filename => "superfile.xls", :template_path => template_string) do |spreadsheet|
  # Funky cool stuff with spreadsheets that will work on Heroku
end
Clone this wiki locally