README.md in columnify-0.1.0 vs README.md in columnify-0.1.1

- old
+ new

@@ -5,10 +5,11 @@ ## Table of contents - [Columnify](#columnify) - [Table of contents](#table-of-contents) - [Installing Columnify](#installing-columnify) + - [Usage](#usage) - [Contributing](#contributing) - [License](#license) - [Code of Conduct](#code-of-conduct) ## Installing Columnify @@ -36,9 +37,20 @@ ```console $ rails g columnify:install ``` This will just register the `xls` mime type inside the `config/initializers/mime_types.rb` file. + +## Usage + +The gem will add a renderer and a template handler for you to easily handle the creation of the Excel file: + +```ruby +# app/views/posts/index.xls.columnify +spreadsheet.worksheet @posts, :id, :title, :content +``` + +So the usage for the views is just to call the `workbook` method, send the array or active record collection, followed by the set of attributes or methods you want to appear on the `xls` file. ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/kurenn/columnify. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.