我做了这个 HAML 链接:
= link_to "Create Profile", signup_path
我在想它应该可以工作,因为这个网址有效:
http://m.cmply.local:8800/signup
但是我得到了这个错误:
undefined local variable or method `signup_path' for #<#<Class:0x129a08190>:0x129a027e0>
这是我的 routes.rb 片段
scope :module => :mobile, :as => :mobile do
constraints(:subdomain => /m/) do
devise_for :users, :path => "", :path_names =>
{ :sign_in => "login", :sign_out => "logout",
:sign_up => "signup" },
:controllers => {:sessions => "mobile/sessions"}
resources :home
resources :disclosures # Will have new, get, look up a disclosure
end
end
这是耙路线片段
{:action=>"create", :controller=>"registrations"}
new_user_registration GET /signup(.:format)
知道为什么会发生这种情况吗?
谢谢!