我使用rails v 2.3.14
我在routes.rb
map.with_options :controller => 'consumer_profile' do |m|
...
m.consumer_profile_show_coupons 'consumer/:id/coupons', :action => 'show_coupons', :requirements => {:id => /c-[0-9a-zA-Z]+/}
...
end
我在consumer_profile_controller.rb
def show_coupons
..
end
我添加了文件consumer_profile/show_coupons.html.erb
耙路线:
consumer_profile_show_coupons /consumer/:id/coupons {:action=>"show_coupons", :controller=>"consumer_profile"}
但是当我使用seo_consumer_profile_coupons_url(current_user.consumer_profile)
时
铁路说:
undefined method `seo_consumer_profile_coupons_url'
有任何想法吗?
答案 0 :(得分:0)
我在:controller=>'consumer_profile',:action=>'show_coupons'
中指出直接link_to
,它有效......