diff --git a/docs/2/pages.md b/docs/2/pages.md index c2b86b8..172d280 100644 --- a/docs/2/pages.md +++ b/docs/2/pages.md @@ -514,6 +514,18 @@ Above, we've set special attributes `icon` and `days` which are now availble: +Now we can access these attributes with the following Mustache tags: + +{{#raw_code}} +
It will be sunny on the following days:
+#{code}
"
+ module MasterViewAddons
+ def raw_code(sub_context)
+ code = sub_context.gsub('{', '{').gsub('}', '}').gsub('<', '<').gsub('>', '>')
+ "#{code}
"
+ end
end
+
+ # now make add the plugin globally available
+ Ruhoh::Views::MasterView.send(:include, MasterViewAddons)
Block helpers should return a String.
+For more information see the [2.x View Helper Plugins upgrade instructions](http://ruhoh.com/docs/2/upgrading/#toc_17).
+
## Contextual Helpers
A mustache contextual helper is a special kind of block helper that acts on a given context (a data-structure),