Rails Wicegrid checkbox filter

292 views Asked by At

I'm using wice grid in my application. I have a model which is having a highlight attribute with boolean values. In wice grid table, I do not want to use the default dropdown filter, instead use some checkbox or toggle button.

<%= grid(event_grid) do |g|
  g.column name: 'Highlight', attribute: 'highlight' do |event|
    event.highlight
  end
end -%>

By default, the filter is dropdown with true and false values. I want to have a checkbox filter instead of dropdown. Let me know if you need any more details... Thanks

1

There are 1 answers

0
Rafael Morales On

try this...

g.column name: 'Highlight', attribute: 'highlight', auto_reload: true do |event|
    check_box "event", "highlight", {:checked => event.highlight, :disabled => true}
end