1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionview/test
Sean Doyle af6f4be040 Ensure tag.with_options({}).p builds a <p>
Prior to this change, the following call raises:

```ruby
with_options(id: "with-options") { |t| t.p "content" }

```

The `ActionView::Helpers::TagHelper::TagBuilder` implementation relies
on `method_missing` to dispatch calls to `tag_string` where the missing
method name is the resulting element's tagName. Unfortunately,
[`Kernel#p` already exists][Kernel#p] and is invoked before
`method_missing` can intervene.

This commit rectifies this by declaring `TagBuilder#p` and overriding
the existent `#p` instance method.

[Kernel#p]: https://ruby-doc.org/core-2.7.2/Kernel.html#method-i-p
2020-10-05 18:41:49 -04:00
..
actionpack Address to false negative for Performance/DeletePrefix,DeleteSuffix 2020-06-14 13:04:47 +09:00
activerecord Address to false negative for Performance/DeletePrefix,DeleteSuffix 2020-06-14 13:04:47 +09:00
fixtures Extend ActionView::Helpers#translate to yield 2020-08-26 20:46:33 +00:00
lib Document view components support (#38656) 2020-03-13 23:52:49 +01:00
template Ensure tag.with_options({}).p builds a <p> 2020-10-05 18:41:49 -04:00
ujs Fix typos [ci skip] 2020-04-22 21:43:37 -07:00
abstract_unit.rb Merge pull request #39939 from Shopify/link-preload-headers 2020-08-17 08:37:22 -04:00
active_record_unit.rb Module#const_set is a public method 2020-09-15 17:19:37 +09:00