Forum: Ruby on Rails redirect_to with an anchor, how ?

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.
19403f509ca90e8ffe072214c6cba896?d=identicon&s=25 oo00oo (Guest)
on 2006-01-18 18:00
(Received via mailing list)
Hello,

I try this :

redirect_to :action => 'infos' , :id => params[:id] , :show =>
"comments#a"

i want this :             .../infos/15?show=comments#a

but I have this :       .../infos/15?show=comments%23a

Someone could tell me how generate an anchor link ?

Thanks
71f1b6b2c3fd9af2e8c52618fb91caa6?d=identicon&s=25 Jules Jacobs (jules)
on 2006-01-18 18:09
redirect_to
  :action => 'infos',
  :id => params[:id],
  :anchor => 'a'

=>

app/controller/infos/3#a

docs:

http://api.rubyonrails.com/classes/ActionView/Help...
19403f509ca90e8ffe072214c6cba896?d=identicon&s=25 oo00oo (Guest)
on 2006-01-18 18:21
(Received via mailing list)
Well I saw the page you gave me, but there is nothing about " :anchor "
on this page

Thanks !
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-01-18 18:24
(Received via mailing list)
I think he meant the *other* url_for :-)

http://api.rubyonrails.com/classes/ActionControlle...

--
Alex
Ef3aa7f7e577ea8cd620462724ddf73b?d=identicon&s=25 Rob Biedenharn (Guest)
on 2006-01-18 18:27
(Received via mailing list)
0091f92762685860109bbcb02edfdf27?d=identicon&s=25 Alain Ravet (Guest)
on 2006-01-18 18:36
(Received via mailing list)
oo00oo

try
	:anchor => the_anchor

Example:
    link_to "text", {:action => 'show_post',  :anchor =>
last_comment.id}, :class => ...


Alain
This topic is locked and can not be replied to.