Displaying 1 result from an estimated 1 matches for "imagecomment".
2006 Jun 26
5
How can I dynamiclly generate models?
...ingletonMethods
    end
    module InstanceMethods
    end
end
init.rb
require ''acts_as_commentable''
ActiveRecord::Base.send(:include, Commentable)
image.rb
acts_as_commentable
This results in Image::Comment, Book::Comment...(I have no idea about 
how defind top level classes ImageComment, BookComment... :( )
and my controller:
def ImageController
  def view
    ...
    @comment=Event::Comment.new  #line 45
    ...
  end
end
everything is ok when I start webrick and direct to this page, but when 
I refresh my brower, an error ocurr:
NameError in ImageController#view
uninitialized...