Module: ActiveScaffold::Bridges::CalendarDateSelectBridge::SearchColumnHelpers

Defined in:
lib/active_scaffold/bridges/calendar_date_select/lib/as_cds_bridge.rb

Instance Method Summary collapse

Instance Method Details

#active_scaffold_search_date_bridge_calendar_control(column, options, current_search, name) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/active_scaffold/bridges/calendar_date_select/lib/as_cds_bridge.rb', line 35

def active_scaffold_search_date_bridge_calendar_control(column, options, current_search, name)
  if current_search.is_a? Hash
    value = controller.class.condition_value_for_datetime(current_search[name], column.column.type == :date ? :to_date : :to_time)
  else
    value = current_search
  end
  calendar_date_select("record", column.name, 
    {:name => "#{options[:name]}[#{name}]",
     :value => (value ? l(value) : nil),
     :class => 'text-input',
     :id => "#{options[:id]}_#{name}",
     :time => column_datetime?(column) ? true : false,
     :style => "display:#{(options[:show].nil? || options[:show]) ? '' : 'none'}"})
end