module PageHelper def inline_editable(template_content_key, placeholder='', default_content='') if @object if placeholder.empty? placeholder = template_content_key + '...' end page = @object class_underscore = @object.class.name.underscore.gsub('/', '_') content = page.template_content[template_content_key] content ||= default_content if @form_action_url """#{ content }""".html_safe else content.html_safe end end end def editable(template_content_key, placeholder='', default_content='') if @object if placeholder.empty? placeholder = template_content_key + '...' end page = @object class_underscore = @object.class.name.underscore.gsub('/', '_') content = page.template_content[template_content_key] content ||= default_content if @form_action_url """
#{ content }
""".html_safe else content.html_safe end end end def redactor(template_content_key, default_content='') if @object page = @object class_underscore = @object.class.name.underscore.gsub('/', '_') content = page.template_content[template_content_key] content ||= default_content if @form_action_url """""".html_safe else content.html_safe end end end def settings(group, name) ::Settings.group(group)[name].value end end