Skip to content

Commit 3160fca

Browse files
committed
rich_text_area renders with errors
1 parent 6733886 commit 3160fca

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

demo/app/controllers/bootstrap_controller.rb

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@ def form
44
@user = User.new(test: "Lorem ipsum")
55

66
@user_with_error = User.new
7-
@user_with_error.errors.add(:username, "Username already taken")
8-
@user_with_error.errors.add(:email, "Invalid email address")
9-
@user_with_error.errors.add(:password, "Another user already uses this password")
10-
@user_with_error.errors.add(:color, "Red is the worst color. Choose another.")
11-
@user_with_error.errors.add(:bio, "Too much information")
12-
@user_with_error.errors.add(:locale, "It's fine, but here's another error")
13-
@user_with_error.errors.add(:date, "Invalid date")
14-
@user_with_error.errors.add(:datetime, "Invalid date and time")
15-
@user_with_error.errors.add(:time, "Invalid time")
16-
@user_with_error.errors.add(:terms, "You never agreed to Terms and Conditions")
7+
@user_with_error.errors.add(:username, "Username already taken")
8+
@user_with_error.errors.add(:email, "Invalid email address")
9+
@user_with_error.errors.add(:password, "Another user already uses this password")
10+
@user_with_error.errors.add(:color, "Red is the worst color. Choose another.")
11+
@user_with_error.errors.add(:bio, "Too much information")
12+
@user_with_error.errors.add(:locale, "It's fine, but here's another error")
13+
@user_with_error.errors.add(:date, "Invalid date")
14+
@user_with_error.errors.add(:datetime, "Invalid date and time")
15+
@user_with_error.errors.add(:time, "Invalid time")
16+
@user_with_error.errors.add(:rich_content, "Too rich, or not rich enough")
17+
@user_with_error.errors.add(:terms, "You never agreed to Terms and Conditions")
1718

1819
@user_with_error.errors.add(:test, "Generic error message")
1920
("a".."z").each do |letter|

demo/app/views/bootstrap/form.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<%= form.date_select :date %>
3434
<%= form.datetime_select :datetime %>
3535
<%= form.time_select :time %>
36+
<%= form.rich_text_area :rich_content, bootstrap: {label: "ActiveText Input", help: "Help Text"} %>
3637
<%= form.check_box :terms, bootstrap: {label: {text: "I agree to Terms and Conditions"}, help: "By clicking Agree you're also acknowledging that Apple may sew your mouth to a ... "} %>
3738
<%= form.primary "Press to Register" do %>
3839
<a href="/" class="btn btn-link">Maybe Later</a>

0 commit comments

Comments
 (0)