Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #11237: remove_unused_and_broken_to_date_tag_method.diff

File remove_unused_and_broken_to_date_tag_method.diff, 1.6 kB (added by danger, 9 months ago)
  • actionpack/lib/action_view/helpers/form_helper.rb

    old new  
    450450      DEFAULT_FIELD_OPTIONS     = { "size" => 30 }.freeze unless const_defined?(:DEFAULT_FIELD_OPTIONS) 
    451451      DEFAULT_RADIO_OPTIONS     = { }.freeze unless const_defined?(:DEFAULT_RADIO_OPTIONS) 
    452452      DEFAULT_TEXT_AREA_OPTIONS = { "cols" => 40, "rows" => 20 }.freeze unless const_defined?(:DEFAULT_TEXT_AREA_OPTIONS) 
    453       DEFAULT_DATE_OPTIONS = { :discard_type => true }.freeze unless const_defined?(:DEFAULT_DATE_OPTIONS) 
    454453 
    455454      def initialize(object_name, method_name, template_object, local_binding = nil, object = nil) 
    456455        @object_name, @method_name = object_name.to_s.dup, method_name.to_s.dup 
     
    531530        tag("input", options) << tag("input", "name" => options["name"], "type" => "hidden", "value" => options['disabled'] && checked ? checked_value : unchecked_value) 
    532531      end 
    533532 
    534       def to_date_tag() 
    535         defaults = DEFAULT_DATE_OPTIONS.dup 
    536         date     = value(object) || Date.today 
    537         options  = Proc.new { |position| defaults.merge(:prefix => "#{@object_name}[#{@method_name}(#{position}i)]") } 
    538         html_day_select(date, options.call(3)) + 
    539         html_month_select(date, options.call(2)) + 
    540         html_year_select(date, options.call(1)) 
    541       end 
    542  
    543533      def to_boolean_select_tag(options = {}) 
    544534        options = options.stringify_keys 
    545535        add_default_name_and_id(options)