最後,我們爲我們的郵件生成了一個有用的鏈接。 generate an real url with rails for an e-mail 這工作得很好,非常好。但是,我們要調用的鞋行動:-)如何使用link_to rails顯示配置文件
<%=link_to('Link', :controller => 'mycontroller', :action => 'show', :id => @mycontroller.id)%>
該URL所以
http://localhost:3000/mycontroller/show/10
我們需要這種結構
http://localhost:3000/mycontroller/10
的rake routes
命令說,這
mycontroller GET /mycontroller/:id(.:format) mycontroller#show
我們怎麼樣等所需的結構?我們是否需要編輯我們的路線,還是有另一種方法來獲得正確的網址?
如何使你的'routes.rb'文件現在看起來?你能把它粘貼在這裏嗎? –