def name_field(object, options = {} )
html = “”
html << "Title : " + select(object, ‘title’)
html << “Given Names :” + text_field(object, ‘given_names’
html << “Family Name :” + text_field(object, ‘family_name’
html
end
def name_field(object, options = {} )
html = “”
html << "Title : " + select(object, ‘title’)
html << “Given Names :” + text_field(object, ‘given_names’
html << “Family Name :” + text_field(object, ‘family_name’
html
end
But know, my question relates to the other one I did earlier in other
post. How can I number the objects? I mean, this returns
but if I want many doctors in the page, all the fields will have the
same ID, therefore I will not be able to differentiate between them.
I mean
or
How can I do that?
Thanks
PS name_field “doctor[1]” does not work
Do this within _doctor.rhtml
<% @doctor = doctor %>
<%= name_field @doctor %>
It will work.
aj
You mean your doctors collection has no ID in it?
for iteration based ID, you would have to keep it as a global variable
as partial for collection means calling the partial many times with a
single object.