liangwenke/to_xls-rails

to_xls doesn't work

Closed this issue · 4 comments

Hi,

I'm running to_xls-rails on Rails 4.1.6. Installed using bundler. Calling to_xls on any activemodel object throws "undefined method 'to_xls'". The gem simply doesn't work, although it is showing as being correctly installed.

I have restarted the server, and added the mimetype as instructed.

Failing code is as follows:

def show
@month = parse_date(flash[:dates]) || Date.today
@charges = @department.charges_for_month(@month)
respond_to do |format|
format.html
format.xls {send_data @department.to_xls }
end
end

I wish I could give you more details but I simply don't have anything else to show!

Thanks in advance.

James

Now just only support Array object,
you can try it for: @department.all.to_xls OR @department.to_a.to_xls

We can close?

Yes! Sorry, this had dropped off my radar

@gurgelrenan Yes, I will close this issue.