2011-02-11 2 views
3

저는 Spree를 사용하고 있고 spree_easy_contact 확장을 설정하고 있습니다. 내가 이메일을 보낼 때true의 경우 'error'가 정의되지 않았습니다. 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 

답변

1

이 문제가이 줄 것 같다 .html {redirect_to (root_path, : notice => t ("message_sended"))}

이 오류가 발생한 위치를 알기 위해 기록을 늘릴 수 있습니까?

자세한 정보를 얻으려면 config.log_level = : debug를 설정할 수 있습니다.

+0

0에 있다면 : 디버그, 맞습니까? – Trip

+0

여기에 언급 된 상징 중 하나 여야합니다 : [Debugging Rails] (http://guides.rubyonrails.org/debugging_rails_applications.html) – etagwerker

관련 문제