3
我正在使用Spree,并设置了spree_easy_contact扩展。未定义的方法`错误'为true:TrueClass
当我发送一封电子邮件,它正确地发送,并正确保存到数据库中,但我重定向到一个错误的屏幕:
NoMethodError in ContactsController#create
undefined method `error' for true:TrueClass
它不给任何提示,以这个地方可能会犯错。有谁知道这个错误是由什么造成的?
这里留在我的日志中的唯一的事情:
NoMethodError (undefined method `error' for true:TrueClass):
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.7ms)
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (4980.8ms)
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (5123.9ms)
这是从创业板公司的contact_controller:
def create
@contact = Contact.new(params[:contact] || {})
respond_to do |format|
if @contact.valid? && @contact.save
ContactMailer.message_email(@contact).deliver
format.html { redirect_to(root_path, :notice => t("message_sended")) }
else
format.html { render :action => "new" }
end
end
end
如果它在0那么它是:调试,对吧? – Trip 2011-02-13 19:38:33