rails--rails/railties/test
Sean Doyle 3500571b43 Improve ActionText extensiblibility
Extensible layout
---

Expose how we render the HTML _surrounding_ rich text content as an
extensible `layouts/action_text/contents/_content.html.erb` template to
encourage user-land customizations, while retaining private API control
over how the rich text itself is rendered by moving the
`#render_action_text_content` helper invocation to the
`action_text/contents/_content.html.erb` partial.

Extensible Attachable `#to_attachable_partial_path`
---

When an application declares a canonical partial for a record, there is
no way to override which partial is used when transformed to Rich Text.
For example, a default `Person < ApplicationRecord` instance returns
`"people/person"` from calls to `#to_partial_path`, resulting in the
`app/views/people/_person.html.erb` partial being rendered.

Prior to this change, when encountering an `<action-text-attachment
sgid="...">` element, ActionText retrieved the corresponding
`Attachable` instance (usually an `ActiveRecord::Base` instance) and
transformed it to rich text HTML by rendering the partial that
corresponds to its `#to_partial_path`.

This proposed change instead invokes
`Attachable#to_attachable_partial_path`. By default,
`#to_attachable_partial_path` is an alias for `#to_partial_path`.

Guides
---

Extend the `guides/action_text_overview` document to
describe how to customize these templates, and to better illustrate how
ActionText::Attachable instances are rendered into HTML.
2020-12-29 20:06:45 -05:00
..
application Make sure db:prepare works even the schema file doesn't exist 2020-12-29 21:58:21 +00:00
command Isolate ARGV in Rails::Command.invoke 2020-02-18 15:02:56 -06:00
commands Add `credentials:diff --disenroll` 2020-12-29 16:46:13 -06:00
configuration Get rid of unnecessary meta programming 2020-10-07 11:12:02 +09:00
engine Use the single line editor in console test 2019-12-24 20:47:21 +09:00
fixtures Test Action Text install generator 2020-11-23 18:07:54 -06:00
generators Improve ActionText extensiblibility 2020-12-29 20:06:45 -05:00
isolation Lock rails/webpacker npm package version to 5 2020-12-22 21:33:00 +09:00
minitest Fix backtraces for generated plugin tests 2020-10-07 15:40:56 -05:00
railties Wrap evaluation of db/seeds.rb with the executor 2020-11-18 16:26:20 -06:00
test_unit Fixed up error output tests and added a missing failure output test. 2020-05-20 15:54:28 -07:00
abstract_unit.rb Revert "You give jruby_skip & rubinius_skip a good name" 2019-08-02 00:24:11 -04:00
app_loader_test.rb
backtrace_cleaner_test.rb Don't modify relative ./ paths in BacktraceCleaner 2019-10-03 14:06:58 -07:00
code_statistics_calculator_test.rb Add support for stylesheets and ERB views to `rails stats`. 2020-11-10 09:40:18 -07:00
code_statistics_test.rb
console_helpers.rb
engine_test.rb
env_helpers.rb Enable `Layout/EmptyLinesAroundAccessModifier` cop 2019-06-13 12:00:45 +09:00
generators_test.rb remove reference to global rails command and replace with bin/rails 2019-12-27 19:32:37 +00:00
initializable_test.rb
json_params_parsing_test.rb
path_generation_test.rb Remove deprecated `config.secret_token` 2019-01-17 16:08:34 -05:00
paths_test.rb
rack_logger_test.rb
rails_info_controller_test.rb Fix secret_key_base for Railties 2019-03-13 16:41:29 -04:00
rails_info_test.rb Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json" 2019-01-08 22:21:20 +01:00
secrets_test.rb
version_test.rb