Skip to content

Instantly share code, notes, and snippets.

@coderforhire
Created February 2, 2012 15:13
Show Gist options
  • Save coderforhire/1723917 to your computer and use it in GitHub Desktop.
Save coderforhire/1723917 to your computer and use it in GitHub Desktop.
NoMethodError (undefined method `email' for nil:NilClass):
app/mailers/notify_mailer.rb:8:in `new_email'
app/controllers/tickets_controller.rb:58:in `create'
@coderforhire
Copy link
Author

@ticket.save
NotifyMailer.new_email(@user,@client).deliver
flash[:notice] = "Thanks for submitting your ticket!"
redirect_to tickets_open_path

@coderforhire
Copy link
Author

2012-02-02 09:32
', "updated_at" = '2012-02-02 15:33:36.317471' WHERE "tickets"."id" = 3
(0.3ms) COMMIT
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", "1"]]
Client Load (0.2ms) SELECT "clients".* FROM "clients" WHERE "clients"."id" = $1 LIMIT 1 [["id", "1"]]
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 2 LIMIT 1
Completed 500 Internal Server Error in 8ms

NoMethodError (undefined method email' for nil:NilClass): app/mailers/notify_mailer.rb:17:inupdate_email'
app/controllers/tickets_controller.rb:72:in block in update' app/controllers/tickets_controller.rb:67:inupdate'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment