Andre Nathan wrote : | Hello | | I'm using this code to search for the latest post of a given category in | my blog: | | <% entry = weblog.find(:match => /^mycategory\//, :lastn => 1).first %> | | Is there a better way to do that search? Maybe using tags? Ideally I'd | like to filter based on a tag name instead of relying on doing a match | that depends on the filesystem layout.
AFAIR, by default if you do not set the Hobix::Entry.no_implicit_tag to
true, each of your entry should have at least a tag named after its
category.
Thus, if you do something like:
entry = weblog.find.find_all {|e| e.tag == "mycategory"}[0]
you should have something working (not tested though).
--
Frederick Ros aka Sleeper -- [EMAIL PROTECTED]
panic("Alas, I survived.\n");
linux-2.6.6/arch/ppc64/kernel/rtas.c
pgpJTI8YW7G4G.pgp
Description: PGP signature
_______________________________________________ Hobix-is-the-way mailing list [email protected] http://rubyforge.org/mailman/listinfo/hobix-is-the-way
