Helper functions can receive the block that they yielddisplay in the block. Sometimes I would like this block to be specified with a filter. For example:
= doc_page title: 'FAQ' do
:markdown
This is not so dry as we always write doc_page and markdown together. Can I get a helper method to accept a block and pass it through a HAML filter. Sort of:
= doc_page title: 'FAQ' do
In this fantasy doc_page, this is a helper method that performs some settings and then transfers the content using markdowns, which allows us to declare :markdowneverywhere and make the world a DRYer place.
source
share