Module: BillyCms::ContentHelper
- Defined in:
- app/helpers/billy_cms/content_helper.rb
Instance Method Summary collapse
Instance Method Details
#cms_image(obj, options = {}) ⇒ Object
16 17 18 19 20 21 |
# File 'app/helpers/billy_cms/content_helper.rb', line 16 def cms_image(obj, = {}) content_tag :div, class: "page-content page-content-binary", 'billycms-attribute' => 'content', 'billycms-page' => obj[:id] do image_tag(obj.content.to_s) + file_field_tag(:obj_input_file) end end |
#page_field(page, field, options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/helpers/billy_cms/content_helper.rb', line 4 def page_field(page, field, = {}) tag_name = [:tag] || :div = { :'billycms-attribute' => field.to_s, :'billycms-page' => page[:id], :contenteditable => false, :class => '' }.merge([:html] || {}) [:class] += " page-#{field.to_s}" content_tag tag_name, page.send(field).to_s.html_safe, end |