Skip to content

Instantly share code, notes, and snippets.

@jamesgecko
Created May 9, 2011 21:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesgecko/963496 to your computer and use it in GitHub Desktop.
Save jamesgecko/963496 to your computer and use it in GitHub Desktop.
class SupportCallsController < ApplicationController
def new
@support_call = SupportCall.new
@support_call.set_employee_id session[:employee_id]
@customers = Customer.all
end
...
end
NoMethodError in Support callsController#new
undefined method `set_employee_id' for #<SupportCall:0x7740f6>
Rails.root: c:/Users/denton/code/billing
Application Trace | Framework Trace | Full Trace
app/controllers/support_calls_controller.rb:4:in `new'
Request
Parameters:
None
Show session dump
Show env dump
Response
Headers:
None
class SupportCall < ActiveRecord::Base
belongs_to :customer
belongs_to :employee
def self.find_from_customer_id(customer_id)
find :all, :conditions => ['customer_id = ?', "%#{customer_id}%"]
end
def self.set_employee_id(id)
self.employee_id = id
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment