ruby - Middleman, where can I add custom methods, which modify output of the views -
i using middleman building api description web page, , wonder if possible define methods somewhere used parse yaml in desired format, looking place can put helper methods
i put mine in config.rb
inside helpers
block, e.g.
helpers def emphasise word word ? "<em>#{word}</em>" : word end def bracket word word ? "(#{word})" : word end end
that helper in scope use in template.
edit: found the section of docs defining custom helpers
Comments
Post a Comment