我正在使用设计,我认为一切正常,直到我试图重置密码。我收到以下错误。设计找不到名为布局/电子邮件的模板。为什么它甚至想要那个?我的印象是,在表单发布后,设计会重定向到用户登录页面。
我怀疑设计无法找到“reset_password_instructions.html.haml”文件,因为它显然能够生成重置令牌,但实际上没有发送任何电子邮件。根据下面的错误消息,这听起来像是正确的诊断吗?
我该怎么做才能解决这个问题?我猜我必须通过覆盖控制器来修改设计,但我不确定。有什么建议么?
Started POST "/users/password" for 127.0.0.1 at 2012-08-06 05:52:42 -0500
Processing by Devise::PasswordsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"kGvuZiu+iu1HAx9xf4RsISj2SM410uLRoR6RbiJcBQw=", "user"=>{"email"=>"test1@example.com"}, "commit"=>"Send me reset password instructions"}
User Load (6.0ms) SELECT "users".* FROM "users" WHERE "users"."email" = 'test1@example.com' LIMIT 1
User Load (1.3ms) SELECT "users".* FROM "users" WHERE "users"."reset_password_token" = '5QZVFAsq2ev22gpQfe9i' LIMIT 1
(0.1ms) BEGIN
(3.0ms) UPDATE "users" SET "reset_password_token" = '5QZVFAsq2ev22gpQfe9i', "reset_password_sent_at" = '2012-08-06 10:52:42.591763', "updated_at" = '2012-08-06 10:52:42.593474' WHERE "users"."id" = 2
(0.5ms) COMMIT
DEPRECATION WARNING: Passing a template handler in the template name is deprecated. You can simply remove the handler name or pass render :handlers => [:haml] instead. (called from call at /Users/bendowney/.rvm/gems/ruby-1.9.3-p194@global/gems/sass-3.1.19/lib/sass/plugin/rack.rb:54)
DEPRECATION WARNING: Passing a template handler in the template name is deprecated. You can simply remove the handler name or pass render :handlers => [:haml] instead. (called from call at /Users/bendowney/.rvm/gems/ruby-1.9.3-p194@global/gems/sass-3.1.19/lib/sass/plugin/rack.rb:54)
Completed 500 Internal Server Error in 113ms
ActionView::MissingTemplate (Missing template layouts/email with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee, :haml]}. Searched in:
* "/Users/bendowney/Sites/RobotimusApp/app/views"
* "/Users/bendowney/.rvm/gems/ruby-1.9.3-p194@RobotimusApp/gems/devise-2.1.2/app/views"
):
actionpack (3.2.5) lib/action_view/path_set.rb:58:in `find'
actionpack (3.2.5) lib/action_view/lookup_context.rb:109:in `find'
actionpack (3.2.5) lib/action_view/renderer/abstract_renderer.rb:3:in `find_template'
actionpack (3.2.5) lib/action_view/renderer/template_renderer.rb:79:in `resolve_layout'
actionpack (3.2.5) lib/action_view/renderer/template_renderer.rb:86:in `resolve_layout'
actionpack (3.2.5) lib/action_view/renderer/template_renderer.rb:69:in `block in find_layout'
actionpack (3.2.5) lib/action_view/lookup_context.rb:228:in `with_layout_format'
#...etc