Flowdock
method

add_default_name_and_id

Importance_0
Ruby on Rails latest stable (v4.0.2) - 0 notes - Class: ActionView::Helpers::InstanceTag

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.2.13) is shown here.

These similar methods exist in v4.0.2:

add_default_name_and_id(options) 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_helper.rb, line 1197
        def add_default_name_and_id(options)
          if options.has_key?("index")
            options["name"] ||= tag_name_with_index(options["index"])
            options["id"] = options.fetch("id"){ tag_id_with_index(options["index"]) }
            options.delete("index")
          elsif defined?(@auto_index)
            options["name"] ||= tag_name_with_index(@auto_index)
            options["id"] = options.fetch("id"){ tag_id_with_index(@auto_index) }
          else
            options["name"] ||= tag_name
            options["id"] = options.fetch("id"){ tag_id }
          end

          options["name"] += "[]" if options["multiple"] && !options["name"].ends_with?("[]")
          options["id"] = [options.delete('namespace'), options["id"]].compact.join("_").presence
        end
Register or log in to add new notes.