Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you recommend good data grid class/gem for Ruby on Rails?

Can you recommend good data grid class/gem for Ruby on Rails? Like http://code.google.com/p/zend-framework-datagrid/ for ZF

like image 917
Fivell Avatar asked Dec 28 '10 15:12

Fivell


3 Answers

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
like image 56
Bogdan Gusiev Avatar answered Oct 27 '22 21:10

Bogdan Gusiev


Not sure if this is what you are looking for but checkout https://github.com/wice/wice_grid

like image 4
SergioB Avatar answered Oct 27 '22 19:10

SergioB


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.

like image 3
Vladimir Georgiev Avatar answered Oct 27 '22 19:10

Vladimir Georgiev