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! :-) John Kopanas 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 Kopanas 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 ??? > >Thanks guys! :-) > >John Kopanas >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 > > >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/railslink_to "Comments", :controller => "post", :action => "view", :id => post.id, :anchor=>''comments'' _Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.
John Kopanas 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 Ross http://tzinfo.rubyforge.org/ -- DST-aware timezone library for Ruby