Forum: Ruby on Rails link_to_remote renders Ajax.Updater, sometimes Ajax.Request

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
90e70a08e69a3584f145ebbd3d95d8d9?d=identicon&s=25 Matt (Guest)
on 2006-06-01 19:00
I'm new to Rails, but am really enjoying working with it.

But i just hit a brick wall...

I have two link_to_remote tags in two seperate _whatever.rhtml files.
The targets of the updates are in edit.rhtml which does a render
:partial to include the links.  here's some code:

<%= link_to_remote 'Destroy',
                :update => "libtable",
                :url => {:action => 'destroylib', :id => lib.id, :rid =>
@release},
                :loading => "Element.show('lib#{lib.id}')",
                :complete => "Element.hide('lib#{lib.id}')",
                :confirm => "Are you sure you want to delete this entry:
#{lib.libfile}"%>

<%= link_to_remote 'Destroy',
         :upate => "packagetable_div",
         :url => {:action => 'destroypackage', :id => package.id, :rid
=> @release},
         :loading => "Element.show('package#{package.id}')",
         :complete => "Element.hide('package#{package.id}')",
         :confirm => "Are you sure you want to delete this entry:
#{package.path}"%>

The first tag properly generates an Ajax.Updater element in the html,
the second generates an Ajax.Request and has no mention of
"packagetable_div".  The end result is that the packagetable_div never
gets updated...

Any ideas as to why this would happen?

Thanks so much!
Matt
90e70a08e69a3584f145ebbd3d95d8d9?d=identicon&s=25 Matt (Guest)
on 2006-06-01 19:13
Matt wrote:

> <%= link_to_remote 'Destroy',
>          :upate => "packagetable_div",
>          :url => {:action => 'destroypackage', :id => package.id, :rid
> => @release},
>          :loading => "Element.show('package#{package.id}')",
>          :complete => "Element.hide('package#{package.id}')",
>          :confirm => "Are you sure you want to delete this entry:
> #{package.path}"%>

wow, :upate != :update

I searched over the code so many times looking for typos, and i find
this minutes after posing to the list!  It always seems to go this way
for me :)

Thanks anyway, and keep up with the good work (Rails)!
Matt
This topic is locked and can not be replied to.