Menu

#15 Problem with start_remote_link_tag in Rails helper

open
nobody
5
2006-11-15
2006-11-15
Anonymous
No

The code for the start_remote_link_tag in the Rails helper is:

##
## ajax version of start_link_tag()
##
def start_remote_link_tag(options={}, html_options={})
<b>s = link_to_remote(options, html_options)</b>
s.sub!(/<\/a>\z/, '')
s
end

alias anchor start_link_tag
alias anchor_remote start_remote_link_tag

It should be:

##
## ajax version of start_link_tag()
##
def start_remote_link_tag(options={}, html_options={})
<b>s = link_to_remote('', options, html_options)</b>
s.sub!(/<\/a>\z/, '')
s
end

alias anchor start_link_tag
alias anchor_remote start_remote_link_tag

The line of interest is the one where the link_to_remote is assigned to s. The first parameter to the call should be an empty string.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB