Link_to and fragment identifiers

Fragment identifiers, it took me 30 minutes just to figure out what
they are called.

I would like to be able to create url that looks like this:
post/view/id#comments

How do I do that with a link_to function?

link_to “Comments”, :controller => “post”, :action => “view”, :id =>
post.id ???

Thanks guys! :slight_smile:

John K.
http://www.kopanas.com

============================================================
http://www.soen.info - Index of online software engineering knowledge
http://www.cusec.net - Canadian University Software Engineering
Conference
http://www.soenlive.com - Presentations from CUSEC

On Friday, May 26, 2006, at 7:50 PM, John K. wrote:


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

link_to “Comments”, :controller => “post”, :action => “view”, :id =>
post.id, :anchor=>‘comments’

_Kevin

John K. wrote:

Fragment identifiers, it took me 30 minutes just to figure out what they
are called.

I would like to be able to create url that looks like this:
post/view/id#comments

How do I do that with a link_to function?

link_to “Comments”, :controller => “post”, :action => “view”, :id =>
post.id ???

Use :anchor, e.g.

link_to “Comments”,
:controller => “post”,
:action => “view”,
:id => post.id,
:anchor => “comments”


Philip R.
http://tzinfo.rubyforge.org/ – DST-aware timezone library for Ruby