我按照devise page上的说明进行操作。唯一不同的是我正在定制注册,他们的例子是在会话上。
当我点击/users/sign_up
页面时,设计正在使用Devise::RegistrationsController#new
操作,而不是来自new
的{{1}}操作
从下面的服务器日志中可以看到,即使用户控制器users_controller.rb
行动XXXXXXXXXX\nxxxxxxxxxxx
new
puts "XXXXXXXXXX\nxxxxxxxxxxx"
Started GET "/users/sign_up" for 127.0.0.1 at 2012-10-14 03:29:52 -0700
Processing by Devise::RegistrationsController#new as HTML
Rendered /Users/jasonkim/.rvm/gems/ruby-1.9.3-p0/gems/devise-2.1.2/app/views/devise/shared/_links.erb (0.4ms)
Rendered users/registrations/new.html.haml within layouts/application (4.8ms)
Completed 200 OK in 88ms (Views: 12.3ms | ActiveRecord: 0.7ms)
class Users::RegistrationsController < Devise::RegistrationsController
def new
@user = User.new
address = @user.address.build
puts "XXXXXXXXXX\nxxxxxxxxxxx"
end
end
devise_for :users, :controllers => { :registration => "users/registration" }
devise_for :employers
我错过了什么?
答案 0 :(得分:0)
应该是
devise_for :users, :controllers => { :registrationS => "users/registrationS" }
尾随's'(但当然是小写)