Forum: Ruby on Rails Accessing Metaweblog API

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
2ffb1f8c2d9d3df4a8dffdc103b2c826?d=identicon&s=25 David Smalley (davidsmalley)
on 2006-02-16 09:46
(Received via mailing list)
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 = and then save
posts back to the blog using

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
blog.rb model.

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
creating models
that do not inherit from ActiveRecord::Base, but this doesn't give
enough information
to be able to suss this out.


David Smalley
This topic is locked and can not be replied to.