glebm / to_spreadsheet

Render XLSX from Rails using existing views (html ⇒ xlsx)
Other
91 stars 37 forks source link

Specifying a filename does not seem to function #23

Open petrosp opened 8 years ago

petrosp commented 8 years ago

Hi,

I am still getting the name of the Controller#action instead of the filename I specify:

def comptoxls
    results = @matcher.compare
    respond_to do |format|
      format.xlsx { render xlsx: :comptoxls, filename: "compare_#{Time.now.strftime('%d-%m-%Y')}"}
    end
end

When I call this action the filename I get is comptoxls.xlsx Is there any hint around this please?

glebm commented 8 years ago

Strange, we do set the filename here. Perhaps you can have a look with a debugger to see what's going on?

waclock commented 8 years ago

I'm having the same problem. Were you able to solve it @petrosp ?