Skip to content

Commit

Permalink
Added wrapper method for rich_text_area
Browse files Browse the repository at this point in the history
  • Loading branch information
shivam091 committed May 25, 2023
1 parent 54c824b commit 175ba2e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rails_bootstrap_form/inputs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module Inputs
autoload :PhoneField
autoload :RadioButton
autoload :RangeField
autoload :RichTextArea
autoload :SearchField
autoload :Select
autoload :StaticField
Expand Down Expand Up @@ -61,6 +62,7 @@ module Inputs
include PhoneField
include RadioButton
include RangeField
include RichTextArea
include SearchField
include Select
include StaticField
Expand Down
21 changes: 21 additions & 0 deletions lib/rails_bootstrap_form/inputs/rich_text_area.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- encoding: utf-8 -*-
# -*- frozen_string_literal: true -*-
# -*- warn_indent: true -*-

module RailsBootstrapForm
module Inputs
module RichTextArea
extend ActiveSupport::Concern

included do
def rich_text_area(attribute, options = {})
options[:class] = ["trix-content", options[:class]].compact.join(" ")

field_wrapper_builder(attribute, options) do
super(attribute, options)
end
end
end
end
end
end

0 comments on commit 175ba2e

Please sign in to comment.