method

add_options

Importance_0
v2.3.8 - 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 569
        def add_options(option_tags, options, value = nil)
          if options[:include_blank]
            option_tags = "<option value=\"\">#{options[:include_blank] if options[:include_blank].kind_of?(String)}</option>\n" + option_tags
          end
          if value.blank? && options[:prompt]
            prompt = options[:prompt].kind_of?(String) ? options[:prompt] : I18n.translate('support.select.prompt', :default => 'Please select')
            option_tags = "<option value=\"\">#{prompt}</option>\n" + option_tags
          end
          option_tags.html_safe
        end
Register or log in to add new notes.