Hi lads!
I have a question about ActiveView::Helpers::InstanceTag
This class has method
private
def add_default_name_and_id(options)
if options.has_key?("index")
options["name"] ||=
tag_name_with_index(options["index"])
options["id"] ||=
tag_id_with_index(options["index"])
options.delete("index")
elsif defined?(@auto_index)
options["name"] ||= tag_name_with_index(@auto_index)
options["id"] ||= tag_id_with_index(@auto_index)
else
options["name"] ||= tag_name + (options.has_key?
(''multiple'') ? ''[]'' : '''')
options["id"] ||= tag_id
end
end
May be i don''t know some thing, but how i can told InstanceTag to
build tag name with ''index'' which i pass and
''multiple'' at once!?
I think that author intend this code:
private
def add_default_name_and_id(options)
if options.has_key?("index")
options["name"] ||=
tag_name_with_index(options["index"])
options["id"] ||=
tag_id_with_index(options["index"])
options.delete("index")
elsif defined?(@auto_index)
options["name"] ||= tag_name_with_index(@auto_index)
options["id"] ||= tag_id_with_index(@auto_index)
else
options["id"] ||= tag_id
options["name"] ||= tag_name
end
options["name"] += ''[]'' if
options.has_key?(''multiple'')
end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-core+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---