2010-01-07 53 views
0

我想知道,因爲我想是這樣鏈接與名稱Attibute在Rails的

<a href="requests/13#new">Comment!<a> 

人都知道,我如何能做到這一點的軌道

問候

+0

你能澄清嗎?你想知道如何做「#新」部分? – 2010-01-07 15:59:41

+0

你的回答就是我一直在尋找的東西......非常感謝你 這個問題是關於在導軌中使用錨鏈接的......我不是一個自然的英語人,所以我不知道這個詞的概念,再次感謝 – forellana 2010-01-11 15:21:07

回答

3
<%= link_to "Comment!", url_for(:controller => "requests", :action => "show", :id => 13, :anchor => "new") %> 

如果您正在使用Request對象和一個寧靜的路線工作。

<%= link_to "Comment!", request_path(@request, :anchor => "new") %> 

更多詳細信息請參見link_to helper documentation