Ahmed Abdelsalam wrote:
> Hello,
>
> I'm using the spreadsheet/excel gem to generate an excel sheet that I
> want user to be able to download it once it's generated. Please take a
> look on the below code:
[snip]
> workbook.close
> send_file "#{RAILS_ROOT}/public/reports/#{file}", :type =>
> 'text/xl; charset=utf-8; header=present', :disposition =>
^^
This is a typo, should be 'text/xls'?
> 'attachement',:filename=>"#{file}"
^^^^^^^^^^^
This is a typo, should be 'attachment'
> The excel sheet is generated correctly, but the last line gives an error
> in the server, and no file is downloaded.
>
> Here is the error:
> NoMethodError (undefined method `call' for nil:NilClass):
>
> I don't know what is the nill class of the above line.
My guess is attachement.
> Can anyone help me?
HTH,
gvb
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.