wice-grid

WiceGrid: Missing block for the grid helper

丶灬走出姿态 提交于 2019-12-12 01:26:25
问题 I am continuing my project using the wice grid. The undefined method capable_of_hosting_filter_related_icons? error was resolved with the help of SO. I am not getting WiceGrid: Missing block for the grid helper.. I was reading through the api and added the other html, id and class attributes. No luck. Below is my view: -grid(@vendors_grid) do |g| g.column name: 'ID', attribute: 'ID'do |vendor| vendor [...] link_to('Edit', vendor_index_path(vendor)) 回答1: Try g.column(name: 'ID', attribute: 'ID

Filter index for CanCan

混江龙づ霸主 提交于 2019-12-11 04:37:04
问题 I am trying to filter the index according to the ability. I am using the wice_grid gem to make a table in the index, and to add a condition to tickets, we could use something called :conditions. I have tried to put it like that: @tickets_grid = initialize_grid(Ticket, :include => [:user, :employee_department, :state], :conditions => [Ticket.accessible_by(current_ability)]) This is not working, though. I'm looking for any suggestions. Update: :conditions is working like ActiveRecord so I guess