Readme.markdown in gitter-1.1.5 vs Readme.markdown in gitter-1.1.6
- old
+ new
@@ -37,11 +37,11 @@
# filter by named scope
filter :topsellers, :scope => :topsellers
# customized filter
- filter :on_stock, do |scope|
+ filter :on_stock do |scope|
scope.where('stock > 0')
end
filter :out_of_stock do |scope|
scope.where(:stock => 0)
@@ -71,13 +71,14 @@
column :description, :header => 'Details'
# make the column sortable
column :name, :sort => true
- # customize your data cell
+ # Customize your data cell
+ # Access your model through variable 'model'
column :price, :sort => true do
- "#{price/100.floor},#{price%100} USD"
+ "#{model.price/100.floor},#{model.price%100} USD"
end
# helpers are accessible via #h
column :details, :header => false do
h.link_to 'details', h.edit_article_path(self)
@@ -105,16 +106,16 @@
```haml
%table
%tr
- @grid.headers.each do |header|
- %th = header
+ %th = header
- @grid.rows.each do |row|
%tr
- row.each do |cell|
- %th = cell
+ %th = cell
```
[More about grids](https://github.com/tracksun/gitter/wiki/Grids)
# Facets
@@ -155,5 +156,7 @@
API inspired by [datagrid](https://github.com/bogdan/datagrid)
# License
Gitter is released under the MIT license
+
+Copyright © 2013 Thomas Sonntag