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

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

+4
source share
4 answers

You can also try the datagrid gem. This focuses not only on grid with columns, but also on 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 
+9
source

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

+2
source

If you are looking for a powerful grid on the client side, support pagination, sorting, grouping, editing, exporting to Excel, PDF, etc., you can check the Shield UI Grid component.

Here is a tutorial on how to integrate it into Rails.

+2
source

If you are looking for things like pagination, ordering, sorting, etc. then rails do it all automatically.

So, for example, if you want to sort the entire row by a specific column, then the header of this column may just be a link that sorted the results by that column and then re-displayed the grid.

So, if you want to build a data grid that is not AJAXy, then this is pretty simple. If you're looking for a way to do this with XHR queries, you can use jQuery to create queries in the background.

Like fas, like a gem that does all this automatically, I couldn’t find it, but I don’t understand why you couldn’t do it yourself with the basics that the rails provide.

0
source

Source: https://habr.com/ru/post/1333579/


All Articles