- 15 4月, 2020 1 次提交
-
-
由 Joel Hawksley 提交于
-
- 09 4月, 2020 1 次提交
-
-
由 Joel Hawksley 提交于
In testing https://github.com/rails/rails/pull/38848 in the GitHub monolith, we realized that we probably should only be annotating HTML output with these comments, at least in their current format. By passing `format` to `erb_implementation`, we set ourselves up to eventually support annotations for other formats as well.
-
- 31 3月, 2020 1 次提交
-
-
由 Joel Hawksley 提交于
As a developer, when looking at a page in my web browser, it's sometimes difficult to figure out which template(s) are being used to render the page. config.action_view.annotate_template_file_names adds HTML comments to the rendered output indicating where each template begins and ends. Co-authored-by: NAaron Patterson <tenderlove@github.com>
-
- 12 4月, 2019 1 次提交
-
-
由 utilum 提交于
-
- 16 3月, 2019 1 次提交
-
-
由 Seb Jacobs 提交于
There was a recent change by @tenderlove to Action view which introduced `ActionView::Base#run` [1]. We ran into an issue with our application because one of the core concepts in our domain model is a `Run` which is exposed in most of our views as a helper method, which now conflicts with this new method. Although this is a public method it is not really meant to be part of the public API. In order to discourage public use of this method and to reduce the chances of this method conflicting with helper methods we can prefix this method with an underscore, renaming this method to `_run`. [1] https://github.com/rails/rails/commit/c740ebdaf5
-
- 16 2月, 2019 1 次提交
-
-
由 Aaron Patterson 提交于
This commit passes the template format to the digestor in order to come up with a key. Before this commit, the digestor would depend on the side effect of the template renderer setting the rendered_format on the lookup context. I would like to remove that mutation, so I've changed this to pass the template format in to the digestor. I've introduced a new instance variable that will be alive during a template render. When the template is being rendered, it pushes the current template on to a stack, setting `@current_template` to the template currently being rendered. When the cache helper asks the digestor for a key, it uses the format of the template currently on the stack.
-
- 12 2月, 2019 1 次提交
-
-
由 Aaron Patterson 提交于
This commit keeps a stack of lookup contexts on the ActionView::Base instance. If a format is passed to render, we instantiate a new lookup context and push it on the stack, that way any child calls to "render" will use the same format information as the parent. This also isolates "sibling" calls to render (multiple calls to render in the same template). Fixes #35222 #34138
-
- 30 1月, 2019 1 次提交
-
-
由 Aaron Patterson 提交于
The AV::Base constructor was too complicated, and this commit tightens up the parameters it will take. At runtime, AV::Base is most commonly constructed here: https://github.com/rails/rails/blob/94d54fa4ab641a0ddeb173409cb41cc5becc02a9/actionview/lib/action_view/rendering.rb#L72-L74 This provides an AV::Renderer instance, a hash of assignments, and a controller instance. Since this is the common case for construction, we should remove logic from the constructor that handles other cases. This commit introduces special constructors for those other cases. Interestingly, most code paths that construct AV::Base "strangely" are tests.
-
- 17 1月, 2019 3 次提交
-
-
由 Aaron Patterson 提交于
Since everything goes through a `run` method, we can pull the buffer assignment up.
-
由 Aaron Patterson 提交于
Methods created by views should always be evaluated against an AV::Base instance. This way we can extract and refactor things in to classes.
-
由 Aaron Patterson 提交于
This pulls the "output buffer existence" conditional up. Instead of evaling the same conditional over and over, we can pull it in to "only compiled once" Ruby code.
-
- 24 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 02 7月, 2017 1 次提交
-
-
由 Matthew Draper 提交于
This reverts commit 3420a145, reversing changes made to afb66a5a.
-
- 01 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 25 1月, 2017 1 次提交
-
-
由 Jeremy Evans 提交于
Erubi offers the following advantages for Rails: * Works with ruby's --enable-frozen-string-literal option * Has 88% smaller memory footprint * Does no freedom patching (Erubis adds a method to Kernel) * Has simpler internals (1 file, <150 lines of code) * Has an open development model (Erubis doesn't have a public source control repository or bug tracker) * Is not dead (Erubis hasn't been updated since 2011) Erubi is a simplified fork of Erubis that contains just the parts that are generally needed (which includes the parts that Rails uses). The only intentional difference in behavior is that it does not include support for <%=== tags for debug output. That could be added to the ActionView ERB handler if it is desired. The Erubis template handler remains in a deprecated state so that code that accesses it directly does not break. It can be removed after Rails 5.1.
-