File: rich_text_area.rb

package info (click to toggle)
ruby-bootstrap-form 5.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 520 kB
  • sloc: ruby: 1,447; makefile: 4
file content (25 lines) | stat: -rw-r--r-- 743 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true

module BootstrapForm
  module Inputs
    module RichTextArea
      extend ActiveSupport::Concern
      include Base

      included do
        def rich_text_area_with_bootstrap(name, options={})
          form_group_builder(name, options) do
            prepend_and_append_input(name, options) do
              options[:class] = safe_join(["trix-content", options[:class]].compact, " ")
              rich_text_area_without_bootstrap(name, options)
            end
          end
        end

        bootstrap_alias :rich_text_area
        alias_method :rich_textarea, :rich_text_area if Rails::VERSION::MAJOR >= 8
        bootstrap_alias :rich_textarea if Rails::VERSION::MAJOR >= 8
      end
    end
  end
end