sinatra-writeexcel
sinatra-writeexcel is a sinatra extension to add support for Excel rendering with writeexcel templates.
Installation
Add this line to your application's Gemfile:
gem 'sinatra-writeexcel'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sinatra-writeexcel
Example
require 'sinatra'
require 'sinatra/writeexcel'
get '/' do
@text = "Hello World!"
writeexcel :world, filename: "hello_world"
end
In views/world.rxls
worksheet = workbook.add_worksheet('Hello')
worksheet.write "A1", @text
##License
See LICENSE.txt
Contributing
- Fork it ( https://github.com/linc01n/sinatra-writeexcel/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request