문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top