Skip to content

Commit

Permalink
Action Text rich_text_area code samples [ci skip]
Browse files Browse the repository at this point in the history
The API documentation for the `rich_text_area` Action View helper
demonstrates how to invoke the helper through a `FormBuilder` instance,
instead of through the `ActionView::Base` instance.

This commit removes the `form.` prefix, and includes examples of calling
the method with an `object_name` positional argument.
  • Loading branch information
seanpdoyle committed Dec 3, 2023
1 parent 6908a66 commit 638c9d5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions actiontext/app/helpers/action_text/tag_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,11 @@ module FormHelper
# * <tt>[:data][:blob_url_template]</tt> - Defaults to <tt>rails_service_blob_url(":signed_id", ":filename")</tt>.
#
# ==== Example
# form_with(model: @message) do |form|
# form.rich_text_area :content
# end
# rich_text_area :message, :content
# # <input type="hidden" name="message[content]" id="message_content_trix_input_message_1">
# # <trix-editor id="content" input="message_content_trix_input_message_1" class="trix-content" ...></trix-editor>
#
# form_with(model: @message) do |form|
# form.rich_text_area :content, value: "<h1>Default message</h1>"
# end
# rich_text_area :message, :content, value: "<h1>Default message</h1>"
# # <input type="hidden" name="message[content]" id="message_content_trix_input_message_1" value="<h1>Default message</h1>">
# # <trix-editor id="content" input="message_content_trix_input_message_1" class="trix-content" ...></trix-editor>
def rich_text_area(object_name, method, options = {})
Expand Down

0 comments on commit 638c9d5

Please sign in to comment.