我正在尝试在邮件视图中使用 url_for 来定义路由:
<%= url_for(
:controller => 'scribe_requests',
:action => 'accept',
:id => @match.acceptance_token,
:only_path => false) %>
我在我的 routes.rb 中定义了路线:
resources :scribe_requests do
member do
match 'accept' => 'scribe_requests#accept', :as => :accept
end
end
我的控制器:
class ScribeRequestsController < ApplicationController
respond_to :html
def accept
..
end
..
end
我不确定这里出了什么问题?我延迟的工作失败了,但有例外
"{没有路由匹配 {:controller=>"scribe_requests", :action=>"accept", :id=>"nv4Nl8wWXLX2zFDm3s3t7w"} /home/syed/.rvm/gems/ruby-1.9.2-p0/gems/ actionpack-3.2.5/lib/action_dispatch/routing/route_set.rb:532:in
raise_routing_error' /home/syed/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.5/lib/action_dispatch/routing/route_set.rb:528:in
rescue in generate' /home/syed/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.5/lib /action_dispatch/routing/route_set.rb:520 :在generate' /home/syed/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.5/lib/action_dispatch/routing/route_set.rb:561:in
生成'/home/syed/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.5/lib/action_dispatch/routing/route_set.rb: 586:inurl_for' /home/syed/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.5/lib/action_dispatch/routing/url_for.rb:148:in
url_for' /home/syed/.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.5/lib/action_view/helpers/url_helper.rb:107:inurl_for' /home/syed/work/projects/mapunity/retina-india/app/views/notifier/scribe_service_needed_email.html.erb:47:in
_app_views_notifier_scribe_service_needed_email_html_erb___981003510_106966530' /home/syed /.rvm/gems/ruby-1.9.2-p0/gems/actionpack-3.2.5/lib/action_view/template.rb:145:在“渲染中的块”中