i have lots of divs, which are added via link_to_remote. now i want to
delete them with a link_to_remote button for each. i am giving them ids
with the same name and a serialized number. when trying to access them
with javascript/rjs, strange things happen: "RJS Error: TypeError:
$(element) has no propertiesâ?. is this a rails, rjs or prototype bug? or
am i missing something?
see my code below
i am rendering forms via partial collection
<%= render :partial => “address/update”, :collection =>
@person.addresses %>
the partial
<%= submit_tag "Aktualisieren" %> <%= end_form_tag %>
the controller
def destroy
Address.find(params[:id]).destroy
return if request.xhr? # render RJS instead
end
the RJS
page.visual_effect :fade, ‘addresslist’+params[:id], :duration => 1
page.replace_html ‘adresslist’+params[:id], ‘’
thanks,
m.zecko