Forum: Ruby on Rails the "#" in code generated by "link_to_remote"

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Tony J. (Guest)
on 2006-05-13 00:26
Currently, helper "link_to_remote" generates html code like '<a
"#" is used for the link of "next" page.

So there comes a problem. "#" stands of the the starting point of
current page.
which means, if the ajax link is at the bottom part of the page, where
scroll bar
needs to be moved to see it, when the ajax link is cliked, the page will
return to
the place for anchor "#", which means, scrolled to top.

Is there an easy way to keep the page not scrolling?


Jonathan V. (Guest)
on 2006-05-13 07:02
(Received via mailing list)
It shouldn't do anything as long as the onclick handler returns false:

  <a href="#" onclick="return false;">Try this</a>

This topic is locked and can not be replied to.