Sha256: afae59774fb7958b607195335984f3402c1fad0af9f0ff52b29913b5dadc173a
Contents?: true
Size: 696 Bytes
Versions: 10
Compression:
Stored size: 696 Bytes
Contents
# Tag for boolean content that is going to be rendered using checkbox # {{ cms:checkbox identifier }} # class ComfortableMexicanSofa::Content::Tag::Checkbox < ComfortableMexicanSofa::Content::Tag::Fragment def content fragment.boolean end def form_field(object_name, view, index) name = "#{object_name}[fragments_attributes][#{index}][boolean]" checkbox_hidden = view.hidden_field_tag(name, "0", id: nil) checkbox_input = view.check_box_tag(name, "1", content.present?, id: nil) yield [checkbox_hidden, checkbox_input].join.html_safe end end ComfortableMexicanSofa::Content::Renderer.register_tag( :checkbox, ComfortableMexicanSofa::Content::Tag::Checkbox )
Version data entries
10 entries across 10 versions & 1 rubygems