Forum: Ruby on Rails How to achieve anchor in the html http://localhost:3000/even

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.
B72610c28afc18f4b817770c8b9accd8?d=identicon&s=25 Neeraj Kumar (Guest)
on 2006-06-01 04:25
(Received via mailing list)
I want to have the final URL something like this

http://localhost:3000/event/event_info/100#comment5

      comment_anchor = '#comment5'
      redirect_to :controller => 'event', :action => 'event_info' , :id
=>
@session[:event_id]

Now how do I pass this comment_anchor as html param to redirect_to ?

Thanks.
13ea48f056b19349027d2f4a6921a46a?d=identicon&s=25 Jean-François (Guest)
on 2006-06-01 12:31
(Received via mailing list)
Hello Neeraj,

> I want to have the final URL something like this
>
> http://localhost:3000/event/event_info/100#comment5
>
>       comment_anchor = '#comment5'
>       redirect_to :controller => 'event', :action => 'event_info' , :id =>
> @session[:event_id]
>
> Now how do I pass this comment_anchor as html param to redirect_to ?

try :

:anchor => comment_anchor

     -- Jean-François.
This topic is locked and can not be replied to.