Exporting to excel in rails using roo gem

3.6k Views Asked by At

I'm exporting some data from table to excel. I'm using roo gem. It seems import is working but there is not sufficient documentation in gem's github repo.

I want to know how to use view file to render data and respond with xlsx format using respond_to.

respond_to do |format|
    format.xlsx
end

Highly appreciated if anyone can provide examples of this.

1

There are 1 best solutions below

0
Vasfed On BEST ANSWER

From https://github.com/roo-rb/roo :

Roo implements read access for all common spreadsheet types

for writing you might want to use something like caxlsx_rails