File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ def selected_values
1313
1414 # Add whitespace before label
1515 def choice_label ( choice )
16- " #{ super ( choice ) } "
16+ ' ' + super
1717 end
1818
1919 # Don't wrap in UL tag
Original file line number Diff line number Diff line change @@ -4,21 +4,19 @@ class FilterStringInput < ::Formtastic::Inputs::StringInput
44 include FilterBase
55 include FilterBase ::SearchMethodSelect
66
7+ # If the filter method includes a search condition, build a normal string search field.
8+ # Else, build a search field with a companion dropdown to choose a search condition from.
79 def to_html
810 if search_conditions =~ method . to_s
911 input_wrapping do
1012 label_html <<
11- builder . text_field ( input_name_simple , input_html_options )
13+ builder . text_field ( method , input_html_options )
1214 end
1315 else
14- super
16+ super # SearchMethodSelect#to_html
1517 end
1618 end
1719
18- def input_name_simple
19- method . to_s . match ( search_conditions ) ? method : "#{ method } _contains"
20- end
21-
2220 def search_conditions
2321 /_(contains|starts_with|ends_with)\z /
2422 end
You can’t perform that action at this time.
0 commit comments