Forum: Ruby on Rails link_to_remote with anchor

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.
Dustin W. (Guest)
on 2007-01-24 00:46
(Received via mailing list)
Anybody no how to set the anchor on link_to_remote?

Thanks,
-dustin
Philip H. (Guest)
on 2007-01-24 00:54
(Received via mailing list)
> Anybody no how to set the anchor on link_to_remote?

My instinct says this isn't possible, but you might look at an
:after_finish (or whatever it's called) along with javascript scrolling
to
scroll to the position you want shown...
gmacgregor (Guest)
on 2007-01-24 07:56
(Received via mailing list)
You mean the actual href attribute, right? Docs say this:

link_to_remote(name, options = {}, html_options = {})

So I would assume something like this:

<%= link_to_remote("Delete this post", :url => { :controller => "post"
:action => "destroy", :id => post.id }, { :href =>
"/post/destroy/#{post.id}" }) %>
This topic is locked and can not be replied to.