【发布时间】:2013-03-19 21:09:47
【问题描述】:
如果我的 Rails routes.rb 文件中有以下路由:
get "time_track/check_in"
我可以在视图中使用的路径变量是什么?我假设类似time_track_check_in_path 或check_in_time_track_path。但是,这些都不起作用:
<%= link_to 'Check-in', check_in_time_track_path %>
<%= link_to 'Check-in', time_track_check_in_path %>
【问题讨论】:
-
rake routes对此有何评论? -
应该是第二个,你遇到什么错误?
-
我一定是搞错了,@Zippie,你是对的。 @slhck,这有助于向我确认它是
time_track_check_in_path,所以我又试了一次,它成功了……我一开始肯定打错了……
标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.2 routes link-to