Hi,

Question...

 I want a model to use info from a file (parks_bielkowski_test.rb)
residing in lib (standard ruby file  containing a method called
"generated_question",  that returns a hash).

The way I have it set up,  I get "You have a nil object when you didn't
expect it!" if I use the symbol  :generated_question in the model (see
below) or, "undefined local variable or method `question_instance' for
#<Question:0x00000100b35be0>" if I try it without the preceding colon
(generated_question)


elsif self.question_type == "generator"

         require
"#{RAILS_ROOT}/lib/generators/parks_bielkowski_test.rb"

         formatted = { :complete_question => :generated_question}
 end


I dont seem to be able to get the model to see the hash created in the
"parks_bielkowski_test" file, and any suggestions would be helpful.

Thanks,
DC

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to