Add editable content helpers

This commit is contained in:
2025-05-28 18:41:53 +04:00
parent 2f86b3c16f
commit 315cf4dd9f
3 changed files with 12 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
module EditableContentHelper
def editable_content_for(path, key, default: nil, create_rich: false)
@content = EditableContent.find_by(path: "contributions/other", key: key)
@content.content.present? ? @content.content : default
end
def markdown_to_html(string)
raw Kramdown::Document.new(string, { input: "GFM" }).to_html
end
end