Skip to content

Instantly share code, notes, and snippets.

@jackcallister
Created August 7, 2013 01:58
Show Gist options
  • Save jackcallister/6170573 to your computer and use it in GitHub Desktop.
Save jackcallister/6170573 to your computer and use it in GitHub Desktop.
Generatively defining a method
self.markdownable_columns.each do |markdown_column|
define_method :"#{markdown_column}_html" do
if value = send(markdown_column)
<Application>::Application.config.markdown_renderer.render(value).html_safe
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment