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.
oo00oo (Guest)
on 2006-01-18 19: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
Jules J. (Guest)
on 2006-01-18 19:09
redirect_to
  :action => 'infos',
  :id => params[:id],
  :anchor => 'a'

=>

app/controller/infos/3#a

docs:

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

Thanks !
Alex Y. (Guest)
on 2006-01-18 19:24
(Received via mailing list)
I think he meant the *other* url_for :-)

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

--
Alex
Rob B. (Guest)
on 2006-01-18 19:27
(Received via mailing list)
Alain R. (Guest)
on 2006-01-18 19: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.