Created
May 9, 2011 21:53
-
-
Save jamesgecko/963496 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SupportCallsController < ApplicationController | |
def new | |
@support_call = SupportCall.new | |
@support_call.set_employee_id session[:employee_id] | |
@customers = Customer.all | |
end | |
... | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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