Search code examples
ruby-on-railsexcelexportroo

Exporting to excel in rails using roo gem


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.


Solution

  • 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