Groups
Groups
Sign in
Groups
Groups
Ruby on Rails: Core
Conversations
About
Send feedback
Help
ActiveView::Helpers::InstanceTag
17 views
Skip to first unread message
faust45
unread,
Oct 27, 2008, 7:50:14 AM
10/27/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ruby on Rails: Core
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
Reply all
Reply to author
Forward
0 new messages