Can you recommend good data grid class/gem for Ruby on Rails? Like http://code.google.com/p/zend-framework-datagrid/ for ZF
You can also try datagrid gem. That is focused not only grids with columns but also filters.
class SimpleReport
include Datagrid
scope do
User.includes(:group)
end
filter(:category, :enum, :select => ["first", "second"])
filter(:disabled, :eboolean)
filter(:confirmed, :boolean)
filter(:group_id, :integer, :multiple => true)
integer_range_filter(:logins_count, :integer)
filter(:group_name, :string, :header => "Group") do |value|
self.joins(:group).where(:groups => {:name => value})
end
column(:name)
column(:group, :order => "groups.name") do |user|
user.name
end
column(:active, :header => "Activated") do |user|
!user.disabled
end
end
Not sure if this is what you are looking for but checkout https://github.com/wice/wice_grid
If you are looking for a powerful client-side grid, supporting pagination, sorting, grouping, editing, export to Excel, PDF, etc, you can check Shield UI's Grid component.
Here's a tutorial on how to integrate it in Rails.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With