Class: Ez::Resources::SearchCell
Constant Summary
collapse
- SEARCHABLE_FIELDS =
%i[string association select link boolean].freeze
ApplicationCell::CSS_SCOPE
Instance Method Summary
collapse
#css_for, #custom_css_map, #div_for, form, #t
Instance Method Details
#cast_field_type(type) ⇒ Object
10
11
12
13
14
15
16
17
18
|
# File 'app/cells/ez/resources/search_cell.rb', line 10
def cast_field_type(type)
case type
when :link then :string
when :boolean then :select
when :association then :string
else
type
end
end
|
20
21
22
23
24
25
26
|
# File 'app/cells/ez/resources/search_cell.rb', line 20
def field_input_name(field)
if association?(field)
search_key(field.name, field.search_suffix, field.options.fetch(:association))
else
search_key(field.name, field.search_suffix)
end
end
|
#field_label(field) ⇒ Object
28
29
30
|
# File 'app/cells/ez/resources/search_cell.rb', line 28
def field_label(field)
field.search_label || "#{field.title} (#{t "search.suffix.#{field.search_suffix}"})"
end
|