Flowdock
method

add_default_name_and_id

Importance_0
Ruby on Rails latest stable (v4.1.8) - 0 notes - Class: Base
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 actionview/lib/action_view/helpers/tags/base.rb, line 74
        def add_default_name_and_id(options)
          if options.has_key?("index")
            options["name"] ||= options.fetch("name"){ tag_name_with_index(options["index"], options["multiple"]) }
            options["id"] = options.fetch("id"){ tag_id_with_index(options["index"]) }
            options.delete("index")
          elsif defined?(@auto_index)
            options["name"] ||= options.fetch("name"){ tag_name_with_index(@auto_index, options["multiple"]) }
            options["id"] = options.fetch("id"){ tag_id_with_index(@auto_index) }
          else
            options["name"] ||= options.fetch("name"){ tag_name(options["multiple"]) }
            options["id"] = options.fetch("id"){ tag_id }
          end

          options["id"] = [options.delete('namespace'), options["id"]].compact.join("_").presence
        end
Register or log in to add new notes.