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
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/yummy_guide/administrate/filters.rb', line 267 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 |