Sha256: fe122eea168e921495fdbf502dd39828983ef2ffda9d8953f5dc86d6e58241a1
Contents?: true
Size: 520 Bytes
Versions: 7
Compression:
Stored size: 520 Bytes
Contents
module Storytime module StorytimeHelpers def storytime_snippet(name) snippet = Storytime::Snippet.find_by(name: name, site: current_storytime_site) if snippet.nil? content = I18n.exists?(name) ? I18n.t(name).html_safe : "Lorem ipsum dolor sit amet, consectetur adipiscing elit..." snippet = Storytime::Snippet.create(name: name, content: content, site: current_storytime_site) end render partial: "storytime/snippets/snippet", locals: {snippet: snippet} end end end
Version data entries
7 entries across 7 versions & 1 rubygems