Newbie question, trying to get data from a mysql database. I can write
to it fine, but when I try to retrieve it I get the following error
message:
C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:260:in
method_missing': undefined method
find’ for #<Stuff id: nil, mp1: nil,
mp2: nil> (NoMethodError)
from C:/rubyapps/stuff/lib/get.rb:16:in `m'
from C:/rubyapps/stuff/lib/get.rb:10:in `initialize'
from C:/rubyapps/stuff/lib/get.rb:22:in `new'
from C:/rubyapps/stuff/lib/get.rb:22
This is the code below.
Thanks for your help
require ‘environment’
require ‘rubygems’
require ‘Stuff’
class Get
def initialize
m
end
def m
@mystuff =Stuff.new
b = @mystuff.find( :all, :select => ‘mp1’)
puts “mp1 has the following values: #{b}”
end
end
Get.new