Sha256: 8d054da83af7ea212ec1f2a5ce9d5d8dc01459f3de07c6fa4cc52daa58843990

Contents?: true

Size: 562 Bytes

Versions: 2

Compression:

Stored size: 562 Bytes

Contents

module Bootstrap
  module ViewHelpers
    module Components
      class Modal < Component
        class Body < Component
          def to_html
            content_tag(:div, options) { block.call(self) if block.present? }
          end

          protected

          def inject_class_name_to_options
            options[:class] = "modal-body #{options[:class]}"
            options[:class].strip!
          end

          def parse_options(options)
            super
            inject_class_name_to_options
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bootstrap-view_helpers-0.0.3 lib/bootstrap/view_helpers/components/modal/body.rb
bootstrap-view_helpers-0.0.2 lib/bootstrap/view_helpers/components/modal/body.rb