Tuesday, 17 September 2013

Filter index for CanCan

Filter index for CanCan

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.

No comments:

Post a Comment