I had this to dynamically add items in html
<td id="campus_list">
<%= link_to_function image_tag("new.png", :width => 16) do |page|
page.insert_html :bottom, 'campus_list', :partial => 'campus_selection'
end %>
<br/>
</td>
the template is like this
<div>
<%= select_tag "campuses[]", options_for_select(AvailableCampuses.map{|item| [name, id]})) %>
<%= link_to_function image_tag("destroy.png", :width => 16), "" %>
</div>
Since I do not know how to add unique id to each rendered div, I can not figure out how to remove each div using link_to_function.
Can you please help me on this?