Sha256: b0cf9bf7d20fd57387c1b6af10856d98d0b9fe88e6f33ee327582fd1d499b842
Contents?: true
Size: 787 Bytes
Versions: 14
Compression:
Stored size: 787 Bytes
Contents
module ContentBlockHelper def editable_content_block(content_block) return raw(content_block.value) unless can? :update, content_block capture do concat content_tag(:div, id: dom_id(content_block, 'preview')) { concat raw(content_block.value) concat button_tag "Edit", class: "btn btn-primary", data: { behavior: 'reveal-editor', target: '#' + dom_id(content_block, 'edit') } } concat form_for([sufia, content_block] ) { |f| concat f.text_area :value, id: "text_area_#{content_block.name}", class: "tinymce", rows: 20, cols: 120 concat f.submit 'Save', class: "btn btn-primary" } end end def tiny_mce_stuff capture do concat tinymce_assets concat tinymce end end end
Version data entries
14 entries across 14 versions & 1 rubygems