Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davydovanton/data_matrix
simple way for creating grids for any data objects and for any frameworks
https://github.com/davydovanton/data_matrix
Last synced: 24 days ago
JSON representation
simple way for creating grids for any data objects and for any frameworks
- Host: GitHub
- URL: https://github.com/davydovanton/data_matrix
- Owner: davydovanton
- License: mit
- Created: 2016-08-18T19:53:56.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-09-10T16:01:33.000Z (about 8 years ago)
- Last Synced: 2024-10-06T04:38:10.793Z (about 1 month ago)
- Language: Ruby
- Size: 11.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# DataMatrix
**[this is not implemented gem]**
Simple way for creating grids for any data objects and for any frameworks.## Installation
Add this line to your application's Gemfile:```ruby
gem 'data_matrix'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install data_matrix
## Usage
Create a Matrix class. Also you can use `:title` option for setting special title:
``` ruby
class UserMatrix < DataMatrix::Base
column :name, title: 'First name'
column :email
column 'address'
end
```Create matrix object in your controller. Your matrix object takes any data object like virtus, AR, hanami-model, siquel-model or dry-types.
```ruby
# in controller@user_matrix = UserMatrix.new(@user)
@user_matrix.compile
```Call your matrix object in view or terminal.
```ruby
@user_matrix.to_html
@user_matrix.to_xml
@user_matrix.to_csv
@user_matrix.to_ascii
```## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/davydovanton/data_matrix. 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.## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).