我有我的haml:
= link_to("Calls Today", todo_path)
在我的routes.rb中:
match "todo/today" => "todo#show_date"
match "todo/today/campaign/:id" => "todo#show_date", :as => "todo"
我的理解是'todo_path'应该找到todo controller和show_date。
答案 0 :(得分:3)
这条路线:
match "todo/today/campaign/:id" => "todo#show_date", :as => "todo"
预计会出现一个id参数。因此,您的link_to应该是:
= link_to("Calls Today", todo_path(:id => your_id))