I’m trying to create an application that interfaces with the metaweblog
API of a remote blog.
I’ve installed a nifty little ruby module called “blog/client” and have
it connecting, and then pulling posts from a blog via the metaweblog API
if I put all the code into my controller.
Now, I wanted to try and put the code into a model so that I can create
a new connection to the blog using @blog = Blog.new(id) and then save
posts back to the blog using @blog.save(post).
Obviously as this doesn’t have an associated database table it shouldn’t
inherit from activerecord::base (is this a correct assumption?). I’ve
tried creating a model like this but Rails just complains back to me
“undefined method `new’ for Blog:Module”
Even though I have specified a new and initialize method within the
Am I going about this the right way? Should I just leave the code in the
There is a brief mention in the pragmatic programmers rails book on
that do not inherit from ActiveRecord::Base, but this doesn’t give
to be able to suss this out.