method

add_options

Importance_0
v3.2.13 - Show latest stable - 0 notes - Class: ActionView::Helpers::InstanceTag
add_options(option_tags, options, value = nil) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_view/helpers/form_options_helper.rb, line 617
        def add_options(option_tags, options, value = nil)
          if options[:include_blank]
            option_tags = content_tag_string('option', options[:include_blank].kind_of?(String) ? options[:include_blank] : nil, :value => '') + "\n" + option_tags
          end
          if value.blank? && options[:prompt]
            prompt = options[:prompt].kind_of?(String) ? options[:prompt] : I18n.translate('helpers.select.prompt', :default => 'Please select')
            option_tags = content_tag_string('option', prompt, :value => '') + "\n" + option_tags
          end
          option_tags
        end
Register or log in to add new notes.