4
用戶模型具有功能設計::無法通過耙分貝創建用戶:種子(失敗confirmation_instructions)
def self.createadmin(
User.create(:email => "[email protected]", :password => "123456e", :password_confirmation => "123456e", :terms_of_service => '1')
end
在耙分貝:種子,我要叫User.createadmin
然而,這失敗
ActionView::Template::Error: ActionView::Template::Error
from /Users/bever/Projects/tr/app/views/devise/mailer/confirmation_instructions.html.erb:3:in `_app_views_devise_mailer_confirmation_instructions_html_erb___1974818942364630283_2154906860'
然後我在createadmin改變了代碼
begin
User.create(:email => "[email protected]", :password => "123456e", :password_confirmation => "123456e", :terms_of_service => '1')
rescue => e
User.create(:email => "[email protected]", :password => "123456e", :password_confirmation => "123456e", :terms_of_service => '1')
end
它的工作原理!任何線索爲什麼會發生這種情況?
你可以發表你的 '/app/views/devise/mailer/confirmation_instructions.html.erb' 標記? – brewster
你確定你沒有在方法'def self.createadmin('? – rapcal