1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionview/lib/action_view/helpers
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
..
tags select_* helpers are public methods 2020-10-02 14:28:54 +09:00
active_model_helper.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
asset_tag_helper.rb Allow callers to remove nopush 2020-08-23 09:53:42 -04:00
asset_url_helper.rb Deprecate starts_with? and ends_with? for String core extensions 2020-05-05 15:51:24 +09:00
atom_feed_helper.rb require "active_support/core_ext/symbol/starts_ends_with" for Ruby 2.6 2020-05-25 05:24:44 +09:00
cache_helper.rb Ensure cache fragment digests include all templates 2020-05-26 15:52:05 -04:00
capture_helper.rb
controller_helper.rb
csp_helper.rb Allow to pass options to csp_meta_tag 2019-02-16 09:36:37 +09:00
csrf_helper.rb
date_helper.rb select_* helpers are public methods 2020-10-02 14:28:54 +09:00
debug_helper.rb
form_helper.rb Form helper methods are public methods 2020-10-02 14:26:08 +09:00
form_options_helper.rb Add label attribute to <option> from include_blank 2020-07-24 15:45:18 -05:00
form_tag_helper.rb Dogfooding "active_support/core_ext/symbol/starts_ends_with" 2020-05-06 14:19:25 +09:00
javascript_helper.rb Fix possible XSS vector in JS escape helper 2020-03-19 09:48:08 -07:00
number_helper.rb Enable HashTransformKeys and HashTransformValues cops 2020-02-20 22:37:32 +00:00
output_safety_helper.rb Updated links from http to https in guides, docs, etc 2019-03-09 16:43:47 +05:30
rendering_helper.rb Document view components support (#38656) 2020-03-13 23:52:49 +01:00
sanitize_helper.rb Require and support rails-html-sanitzer 1.2.0 2019-08-09 00:07:45 +02:00
tag_helper.rb Ensure tag.with_options({}).p builds a <p> 2020-10-05 18:41:49 -04:00
tags.rb
text_helper.rb Use match? where we don't need MatchData 2019-07-29 14:23:10 +09:00
translation_helper.rb Improve Action View translate helper 2020-09-16 10:18:54 -05:00
url_helper.rb Use URI::DEFAULT_PARSER rather than instantiate a new one 2020-06-29 23:06:34 +02:00