Adding a destination anchor in the link


#1

hi, I would like to specify a destination anchor in the generated link
with
the link_to helper, so the navigator opens the document at the given
point.
it should look something like this:
/blog/archive/2006/01/10/test-post.html#comments
I tried it with the following code:
<% link_to(“comments”,
:controller => “blog”,
:action => “archive”,
:year => post.date.year,
:month => post.date.month,
:day => post.date.day,
:id => “#{post.id}.html#comments”) %>

the problem is that that the ‘#’ char is escaped and printed
as “/blog/archive/2006/01/10/test-post.html%23comments” so it doesnt
work

is there any way to avoid a link from being escaped? any possible
solution
for this?

thanks in advance


#2

On Jan 12, 2006, at 19:16, Borja Martín wrote:

hi, I would like to specify a destination anchor in the generated link

:anchor => ‘comments’


Jakob S. - http://mentalized.net