negation: true
adds a checkox to a text filter. The checked checkbox is the logical
NOT
- it changes the semantics of a text filter to
not
showing all records with a matching substring.
# encoding: utf-8 class NegationController < ApplicationController def index @tasks_grid = initialize_grid(Task, include: [:priority, :status, :project], order: 'statuses.name', custom_order: { 'tasks.priority_id' => 'priorities.name', 'tasks.status_id' => 'statuses.position', 'tasks.project_id' => 'projects.name' } ) end end
<%= grid(@tasks_grid) do |g|
g.column name: 'ID', attribute: 'id', filter: false
g.column name: 'Title', attribute: 'title', negation: true
g.column name: 'Priority', attribute: 'priority_id', custom_filter: Priority.to_dropdown do |task|
task.priority.name if task.priority
end
g.column name: 'Status', attribute: 'status_id', custom_filter: Status.to_dropdown do |task|
task.status.name if task.status
end
g.column name: 'Project Name', attribute: 'project_id', custom_filter: Project.to_dropdown do |task|
task.project.name if task.project
end
g.column name: 'Archived', attribute: 'archived' do |task|
task.archived? ? 'Yes' : 'No'
end
g.column name: 'Added', attribute: 'created_at' do |task|
task.created_at.to_s(:short)
end
g.column do |task|
link_to('Edit', edit_task_path(task))
end
end -%>
.well %h2= current_page_title %p %code negation: true adds a checkox to a text filter. The checked checkbox is the logical %i NOT \- it changes the semantics of a text filter to %b not showing all records with a matching substring. = show_code .row-fluid .col-md-12 = render 'grid'
ID | Title | Priority | Status | Project Name | Archived | Added | |
---|---|---|---|---|---|---|---|
1-20 / 500 Alle rijen tonen | |||||||
142 | maxime accusamus consectetur | Assigned | Super Game | No | 31 May 12:37 | Edit | |
157 | rerum | Low | Assigned | Super Game | No | 12 Jun 12:37 | Edit |
99 | soluta | High | Assigned | Divine Firmware | No | 25 Mar 12:37 | Edit |
127 | doloribus ut | Assigned | Divine Firmware | No | 06 Jun 12:37 | Edit | |
61 | quia architecto | Normal | Assigned | Divine Firmware | No | 15 May 12:37 | Edit |
146 | adipisci et | Low | Assigned | Ultimate Website | Yes | 06 Apr 12:37 | Edit |
62 | eum velit saepe | Normal | Assigned | Divine Firmware | No | 15 Mar 12:37 | Edit |
91 | quaerat | High | Assigned | Divine Firmware | No | 08 Jun 12:37 | Edit |
26 | quia mollitia deleniti | Urgent | Assigned | Super Game | No | 23 May 12:37 | Edit |
118 | hic | Assigned | Ultimate Website | No | 25 Mar 12:37 | Edit | |
3 | aliquam repudiandae | Anecdotic | Assigned | Divine Firmware | No | 21 Mar 12:37 | Edit |
46 | facere | Anecdotic | Assigned | Ultimate Website | Yes | 26 Apr 12:37 | Edit |
145 | asperiores | Low | Assigned | Super Game | No | 05 Jun 12:37 | Edit |
53 | molestiae | Assigned | Super Game | No | 21 Apr 12:37 | Edit | |
16 | omnis | High | Assigned | Super Game | No | 21 Mar 12:37 | Edit |
2 | ut sint | Anecdotic | Assigned | Divine Firmware | No | 09 Apr 12:37 | Edit |
44 | id temporibus eligendi | Assigned | Ultimate Website | No | 27 Mar 12:37 | Edit | |
80 | corrupti officia | Urgent | Assigned | Super Game | No | 12 Mar 12:37 | Edit |
20 | aspernatur eligendi adipisci | High | Assigned | Ultimate Website | No | 30 May 12:37 | Edit |
158 | aut voluptatibus aut | Normal | Assigned | Super Game | No | 12 Apr 12:37 | Edit |