Redirect_to with an anchor, how?


#1

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


#2

redirect_to
:action => ‘infos’,
:id => params[:id],
:anchor => ‘a’

=>

app/controller/infos/3#a

docs:

http://api.rubyonrails.com/classes/ActionView/Helpers/UrlHelper.html


#3

Well I saw the page you gave me, but there is nothing about " :anchor "
on this page

Thanks !


#4

I think he meant the other url_for :slight_smile:

http://api.rubyonrails.com/classes/ActionController/Base.html#M000174


Alex


#5

Try:
http://api.rubyonrails.com/classes/ActionController/Base.html#M000174

-Rob


#6

oo00oo

try
:anchor => the_anchor

Example:
link_to “text”, {:action => ‘show_post’, :anchor =>
last_comment.id}, :class => …

Alain