Sha256: d1d6346a681cb8bdba5115e2687f96f71b7bed2cda668a6e462333551855ca24
Contents?: true
Size: 814 Bytes
Versions: 29
Compression:
Stored size: 814 Bytes
Contents
# File must be name in underscore casing and the module name must be named in # CamelizeCasing. The file must also end in _helper.rb by convention. # More info http://lono.cloud/docs/helpers # Custom Helpers are loaed into the same scope as built-in lono helpers and are # treated a first class citizens. They have access to all the same methods # and instance variable as the built-in lono helpers. module MyCustomHelper # This example helper method checks if the file path exists and fails gracefully # the built-in partial fails hard. def shared_partial(name, options={}, indent=0) partial_name = "shared/#{name}.yml.erb" if partial_exist?(partial_name) # partial_exist? is built-in lono helper result << partial(partial_name, {}, indent: indent) result.join("\n") end end end
Version data entries
29 entries across 29 versions & 1 rubygems