2013-02-19 27 views
0

我用導軌v 2.3.14梁2未定義的方法

我加入航線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 

加DEF我添加文件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

我指出在link_to的直接:controller=>'consumer_profile',:action=>'show_coupons',它的工作原理是...