1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actiontext/CHANGELOG.md
matt swanson 9b6459aab6
Add support for eager loading all rich text associations at once (#39397)
* Add `with_all_rich_text` method to eager load all RichText models at once

* Update actiontext/test/test_helper.rb

Co-authored-by: Kasper Timm Hansen <kaspth@gmail.com>

* Update actiontext/lib/action_text/attribute.rb

Co-authored-by: Kasper Timm Hansen <kaspth@gmail.com>

Co-authored-by: Kasper Timm Hansen <kaspth@gmail.com>
2020-11-24 18:19:46 +01:00

2.2 KiB

  • Add with_all_rich_text method to eager load all rich text associations on a model at once

    Matt Swanson, DHH

Rails 6.1.0.rc1 (November 02, 2020)

  • Declare ActionText::FixtureSet.attachment to generate an <action-text-attachment sgid="..."></action-text-attachment> element with a valid sgid attribute.

    hello_world_review_content:
      record: hello_world (Review)
      name: content
      body: <p><%= ActionText::FixtureSet.attachment("messages", :hello_world) %> is great!</p>
    

    Sean Doyle

  • Locate fill_in_rich_text_area by <label> text

    In addition to searching for <trix-editor> elements with the appropriate aria-label attribute, also support locating elements that match the corresponding <label> element's text.

    Sean Doyle

  • Be able to add a default value to rich_text_area.

    form.rich_text_area :content, value: "<h1>Hello world</h1>"
    #=> <input type="hidden" name="message[content]" id="message_content_trix_input_message_1" value="<h1>Hello world</h1>">
    

    Paulo Ancheta

  • Add method to confirm rich text content existence by adding ? after rich text attribute.

    message = Message.create!(body: "<h1>Funny times!</h1>")
    message.body? #=> true
    

    Kyohei Toyoda

  • The fill_in_rich_text_area system test helper locates a Trix editor and fills it in with the given HTML.

    # <trix-editor id="message_content" ...></trix-editor>
    fill_in_rich_text_area "message_content", with: "Hello <em>world!</em>"
    
    # <trix-editor placeholder="Your message here" ...></trix-editor>
    fill_in_rich_text_area "Your message here", with: "Hello <em>world!</em>"
    
    # <trix-editor aria-label="Message content" ...></trix-editor>
    fill_in_rich_text_area "Message content", with: "Hello <em>world!</em>"
    
    # <input id="trix_input_1" name="message[content]" type="hidden">
    # <trix-editor input="trix_input_1"></trix-editor>
    fill_in_rich_text_area "message[content]", with: "Hello <em>world!</em>"
    

    George Claghorn

Please check 6-0-stable for previous changes.