class ActiveAdmin::Inputs::FilterDateRangeInput

Public Instance Methods

gt_input_name() click to toggle source
# File lib/active_admin/inputs/filter_date_range_input.rb, line 16
def gt_input_name
  "#{method}_gteq"
end
Also aliased as: input_name
input_html_options(input_name = gt_input_name) click to toggle source
# File lib/active_admin/inputs/filter_date_range_input.rb, line 25
def input_html_options(input_name = gt_input_name)
  current_value = @object.send(input_name)
  { :size => 12,
    :class => "datepicker",
    :max => 10,
    :value => current_value.respond_to?(:strftime) ? current_value.strftime("%Y-%m-%d") : "" }
end
input_name()
Alias for: gt_input_name
lt_input_name() click to toggle source
# File lib/active_admin/inputs/filter_date_range_input.rb, line 21
def lt_input_name
  "#{method}_lteq"
end
to_html() click to toggle source
# File lib/active_admin/inputs/filter_date_range_input.rb, line 6
def to_html
  input_wrapping do
    [ label_html,
      builder.text_field(gt_input_name, input_html_options(gt_input_name)),
      template.content_tag(:span, "-", :class => "seperator"),
      builder.text_field(lt_input_name, input_html_options(lt_input_name)),
    ].join("\n").html_safe
  end
end