Use
allow_multiple_selection: false
to turn off mutiple selection in custom filters.
# encoding: utf-8 class CustomFilters4Controller < ApplicationController def index @tasks_grid = initialize_grid(Task, include: [:relevant_version, :expected_version, :project], conditions: ['projects.id = ?', Project.first], custom_order: { 'tasks.expected_version_id' => 'expected_versions_tasks.name' } ) end end
<%= grid(@tasks_grid) do |g|
g.column name: 'ID', attribute: 'id', filter: false
g.column name: 'Title', attribute: 'title'
g.column name: 'Found in version', assoc: :relevant_version,
attribute: 'name', custom_filter: :auto, allow_multiple_selection: false do |task|
task.relevant_version.name if task.relevant_version
end
g.column name: 'Expected in version', attribute: 'expected_version_id',
custom_filter: [:expected_version, :to_option], allow_multiple_selection: false do |task|
task.expected_version.name if task.expected_version
end
g.column do |task|
link_to('Edit', edit_task_path(task))
end
end -%>
.well %h2= current_page_title %p Use %code allow_multiple_selection: false to turn off mutiple selection in custom filters. = show_code .row-fluid .col-md-12 = render 'grid'
ID | Title | Found in version | Expected in version | |
---|---|---|---|---|
1-20 / 150 show all | ||||
6 | molestiae autem | 1.2 | Edit | |
7 | ut veniam | 3.0 | Edit | |
9 | quisquam in iste | Edit | ||
13 | ut | 2.0 | Edit | |
14 | repellat consequatur velit | 2.0 | 2.0 | Edit |
20 | aspernatur eligendi adipisci | 3.0 | Edit | |
27 | eum vel | Edit | ||
29 | et | 1.0 | 2.0 | Edit |
31 | debitis pariatur illo | 1.0 | 1.0 | Edit |
32 | voluptatem ipsam libero | 2.0 | 3.0 | Edit |
33 | voluptatem | 1.2 | 1.1 | Edit |
36 | placeat | 2.0 | Edit | |
37 | et | 3.0 | 3.0 | Edit |
42 | aut | 1.2 | Edit | |
44 | id temporibus eligendi | Edit | ||
46 | facere | 3.0 | Edit | |
47 | temporibus iure delectus | Edit | ||
49 | laborum | 3.0 | Edit | |
54 | minima in voluptatem | Edit | ||
59 | alias libero | 3.0 | Edit |