I have a controller that calls a model method:
class WelcomeController < ApplicationController
item_num = params[:item_num] || "0001"
@product = Scraper.lookup_item(item_num)
end
Here is the Scraper
model:
class Scraper < ActiveRecord::Base
require 'nokogiri'
require 'mechanize'
def self.lookup_item(item_num)
# code goes here
end
end
Why am I getting this error?
NoMethodError: undefined method 'lookup_item' for Scraper:Module