- Fixed :filter_width not working for select filters.
- Giving a Hash as :format option gives the corresponding value.
- We now allow column presets:
Tabulatr.config do |config|
#…
config.column_presets({
config.column_presets({
:action_column => {:width => ’100px’},
:smallint => { :width => ‘55px’, :filter_width => ‘30px’, :align => ‘right’ },
:id => :smallint,
:sid => { :width => ‘200px’, :filter_width => ‘170px’, :filter => :like },
:title => { :filter => :like },
:count => { :map => false, :width => ‘40px’, :filter => false, :align => ‘right’ },
:moo => { :width => ‘155px’, :filter_width => ‘120px’, :align => ‘right’ }
})
end
Now, every column will check whether there is as entry corresponding to its name in this table and get the content as ‘default’ options.
<%= table_for @regions do |t| t.column :id t.column :sid
- …
end %>
so, the :id column has all the options defined above. The :action_column entry is used for ‘action’ columns.
But even better, you can use arbitrary presets:
t.column :foo, :preset => :moo
gets the :moo preset.
- Fixed two more bugs breaking ruby 1.8 compatibility. (Thanks to moabite for reporting)
- Fixed a “bug” breaking ruby 1.8 compatibility. (Thanks to moabite for reporting)
- Mongoid now really works.
- A lot of cleanup in the finder code (million thanks to plukevdh)
- You can use table_for for ‘normal’ arrays that weren’t found with find_for_table.
- Added a :name_mapping option to find_for_table to allow filtering by compund expressions, example:
@customers = Customer.find_for_table(params, name_mapping: { name: ‘(“addresses”.“firstname” || \’ \’ || “addresses”.“lastname”)’, address: ‘(“addresses”.“street” || \’ \’ || “addresses”.“zip_code” || \’ \’ || “addresses”.“city”)’ }, default_order: ‘updated_at desc’ )
- Added Mysql2Adapter to the ActiveRecord connection list (thanks to AaronLasseigne).
- Monkeypatch mongoid only if it is present. (thanks to rwz)
- Converted into a Rails 3.1 engine and moved css and images to use the new asset pipeline. Works with 3.0.x — ’opefully. Thanks to all that reported the problem.
- Header cells are now auto translated. Thanks to niedhui!
- Fixed a ruby 1.8 syntax issue. (Thanks to TBAA for reporting.)
- Mongoid can also be used in place of ActiveRecord
- fixed handling of the primary_key column and name
- Added dom_id to tables tr. Thanks to sterrym (Tim Glen)!
- Added note on “Request-URI Too Large error” to README
- nicer table headers. Thanks to troya2 (Troy Anderson)!
- Fixed bug with nil exception on ‘empty’ belongs_to association. Thanks to dgm!
- Fixed bug with “Select …” buttons introduced in 0.1.0.
- Added tests for these buttons.
- new find_for_table option :stateful. If
MyFancyModel.find_for_table params, :stateful => session
is given, the current sorting, filtering, selecting and paging information is stored to the session and restored when reopened. Great for procession specifically filtered lists.
- new column option :map (defaults to true) to disable automatic mapping on the enries of the association as in
<%= table_for @products do |t| … t.association :tags, :title # mapped to all tags t.association :tags, :count, :map => false # called on the list-of-tags end %>
- fixed the path to paging/sorting images installed by generator. Thanks to sdsykes!