开发者

What are the arguments/options for @pages.find() in Webby?

When using Webby to generate a static website, the content and layout are processed through erb. The program provides a '@pages' variable which contains information about all the pages being generated. I've seen several examples make use of a '@pages.find()' method to select/sort/filter the contents of the variable.

My question is: Where is开发者_开发问答 the documentation for this method and/or how is it actually used? The documentation on the Webby site doesn't go into any detail on this feature, so I assume it comes from outside the application itself.

I'm only passingly familiar with ruby, but I have a feeling this is a feature of ruby or ruby-on-rails that many people take for granted making it hard to find information. The fact that the method is named 'find' doesn't help the google results much, either. The closest thing I've been able to find is documentation for 'ActiveRecord::Base.find()' which seems similar but after some testing it seems like it's not exactly the same thing.

If anybody could point me to the correct documentation, explain the method, or otherwise point me in the right direction, that would be great.


Okay, sorry. I asked my question about five minutes too soon. I'll just answer it myself in case someone else gets into the same situation:

It is in fact defined inside the Webby code, and the reference is here: http://webby.rubyforge.org/rdoc/classes/Webby/Resources/DB.html

@pages is an instance of the Webby::Resources::DB class, and the documention for the find method is on the page linked above.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜