You should be able to do this:
link_to_remote(task.id_description,
{:update => {:success => "div1", :failure => "div2"},
:url => {:action => :some_action, :id => id},
:id => id,
:before => "Element.show('spinner')",
:complete => "Element.hide('spinner'); some_function('#
{id}')"})
On Feb 2, 2:00 pm, Ben <[email protected]> wrote:
> When using something like
>
> link_to_function "Label", "some_function(this);"
>
> the 'this' references the href generated by the rails
> link_to_function.
>
> When using something like
>
> link_to_remote(task.id_description,
> {:update => {:success => "div1", :failure => "div2"},
> :url => {:action => :some_action, :id => id},
> :id => id,
> :before => "Element.show('spinner')",
> :complete => "Element.hide('spinner'); some_function(this)"})
>
> the 'this' references something different, I believe the Ajax call
> itself.
>
> Is there a way of accessing the href as you can in the
> link_to_function? I want to be able to access it so I can change its
> className to indicate its been selected and change all the other hrefs
> on the same level to be unselected.
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---