The user model has a function
def self.createadmin( User.create(:email => " abc@gmail.com ", :password => "123456e", :password_confirmation => "123456e", :terms_of_service => '1') end
In rake db: seed, I have to call User.createadmin
However this does not work
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'
Then I changed the code in createadmin
begin User.create(:email => " abc@gmail.com ", :password => "123456e", :password_confirmation => "123456e", :terms_of_service => '1') rescue => e User.create(:email => " abc@gmail.com ", :password => "123456e", :password_confirmation => "123456e", :terms_of_service => '1') end
It works! Any clues why this is happening?
source share