Undefined `error 'method for true: TrueClass

I use Spree and configure the spree_easy_contact extension.

When I send an email, it sends correctly and saves it in the database correctly, but I am redirected to the error screen:

NoMethodError in ContactsController#create

undefined method `error' for true:TrueClass

There are no hints as to where this might get lost. Does anyone know what caused this error?

Only one thing remains in my journal:

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)

This is from contact 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
+3
source share
1 answer

It seems that the problem is in this line:

format.html {redirect_to (root_path ,: notice => t ("message_sended"))}

Can you increase the registration to see where this error occurs?

, config.log_level =: debug, .

+1

Source: https://habr.com/ru/post/1791523/


All Articles