-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1646 from morsedigital/master
Added RichTextAreaInput for ActionText
- Loading branch information
Showing
4 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# frozen_string_literal: true | ||
module SimpleForm | ||
module Inputs | ||
class RichTextAreaInput < Base | ||
def input(wrapper_options = nil) | ||
merged_input_options = merge_wrapper_options(input_html_options, wrapper_options) | ||
|
||
@builder.rich_text_area(attribute_name, merged_input_options) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# frozen_string_literal: true | ||
# encoding: UTF-8 | ||
require 'test_helper' | ||
|
||
class RichTextAreaInputTest < ActionView::TestCase | ||
test 'input generates a text area for text attributes' do | ||
with_input_for @user, :description, :text | ||
assert_select 'textarea.text#user_description' | ||
end | ||
|
||
test 'input generates a text area for text attributes that accept placeholder' do | ||
with_input_for @user, :description, :text, placeholder: 'Put in some text' | ||
assert_select 'textarea.text[placeholder="Put in some text"]' | ||
end | ||
end |