"RJS Error: TypeError: $(element) has no properties"

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

[<%= link_to_remote 'x', :url => {:controller => "address", :action => "destroy", :id => update.id} %>]
<%= form_remote_tag( :url => { :controller => "address", :action => "update" }, :html =>{:name => update.id}) %>
Land
<%= text_field "address", "country", "size" => 30, :value => update.country %>

<%= 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

Hey,
I’m having the exact same problem! I’ll let you know if I figure it
out.
Bri

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs