Class: YummyGuide::Administrate::Filters::DateRange
- Defined in:
- lib/yummy_guide/administrate/filters.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#initialize, #label_text, #visible?, #with_name, with_options
Constructor Details
This class inherits a constructor from YummyGuide::Administrate::Filters::Base
Instance Method Details
#row(view_context, form, _scope, current_values, locals) ⇒ Object
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/yummy_guide/administrate/filters.rb', line 234 def row(view_context, form, _scope, current_values, locals) from_name = ([:from] || :"start_#{name}").to_sym to_name = ([:to] || :"end_#{name}").to_sym view_context.content_tag(:tr) do view_context.safe_join([ label_cell(view_context, form, locals), view_context.content_tag(:td) do view_context.safe_join([ form.date_field(from_name, value: current_values[from_name.to_s].presence || evaluate_option([:from_default], view_context, locals)), view_context.content_tag(:span, "〜"), form.date_field(to_name, value: current_values[to_name.to_s].presence || evaluate_option([:to_default], view_context, locals)) ]) end, clear_cell(view_context) ]) end end |