aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #35121 from utilum/warning_tried_to_create_proc_without_blockKasper Timm Hansen2019-03-101-2/+2
|\ | | | | Ruby 2.7 warning: creating a Proc without a block
| * Ruby 2.7 warning: creating a Proc without a blockutilum2019-02-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of [Revision 66772]( https://bugs.ruby-lang.org/projects/ruby-trunk/repository/trunk/revisions/66772) `Proc.new` without giving a block emits `warning: tried to create Proc object without a block`. This commit fixes cases where Rails test suit tickles this warning. See CI logs: https://travis-ci.org/rails/rails/jobs/487205819#L1161-L1190 https://travis-ci.org/rails/rails/jobs/487205821#L1154-1159 https://travis-ci.org/rails/rails/jobs/487205821#L1160-L1169 https://travis-ci.org/rails/rails/jobs/487205821#L1189 https://travis-ci.org/rails/rails/jobs/487254404#L1307-L1416 https://travis-ci.org/rails/rails/jobs/487254405#L1174-L1191
* | Merge pull request #35559 from ↵Kasper Timm Hansen2019-03-091-0/+2
|\ \ | | | | | | | | | | | | ashishprajapati/ashishprajapati/important_textual_improvements Added missing guide links in documentation and minor wording fix
| * | Added missing guide links in README documentation and minor wording fix [ci ↵ashishprajapati2019-03-101-0/+2
| | | | | | | | | | | | skip]
* | | Revert an incorrect change in jquery-2.2.0.jsSharang Dashputre2019-03-101-2/+2
| | |
* | | Fix links in gemspec and docs from http to https.Abhay Nikam2019-03-091-1/+1
| | |
* | | Merge pull request #35529 from ↵Ryuta Kamizono2019-03-094-5/+5
|\ \ \ | | | | | | | | | | | | | | | | abhaynikam/35492-follow-up-to-updates-links-to-https Updated links from http to https in guides, docs, etc
| * | | Updated links from http to https in guides, docs, etcAbhay Nikam2019-03-094-5/+5
| | | |
* | | | [ci skip] Minor documentation fixes for consistencyShailesh Kalamkar2019-03-091-1/+1
| |/ / |/| |
* | | Read the CSP nonce on page loadGeorge Claghorn2019-03-082-4/+10
|/ / | | | | Turbolinks replaces the CSP nonce <meta> tag on page change, but inline scripts inserted by UJS need the nonce from the initial page load. In general, it doesn't matter to UJS if the nonce changes after the page loads: only the initial value is relevant.
* | [ci skip] Fix typosShailesh Kalamkar2019-03-071-1/+1
| |
* | Merge pull request #35429 from jhawthorn/template_format_nilAaron Patterson2019-03-018-17/+13
|\ \ | | | | | | Allow nil format on templates
| * | Remove query_format argument from resolverJohn Hawthorn2019-02-263-5/+5
| | |
| * | Create templates with format=nilJohn Hawthorn2019-02-265-7/+8
| | |
| * | Allow format to be nilJohn Hawthorn2019-02-261-5/+0
| | |
* | | Removes unnecessary dot in regexpXavier Noria2019-02-281-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A string S matches ([.]|\b)html if an only if matches \bhtml: * If S matches [.]html, then it matches \bhtml. * If S matches \bhtml, then it matches \bhtml. Reciprocally: * If S matches \bhtml, then it matches ([.]|\b)html. The character class can be removed, and since we are on it we remove the group too so that it is clear to a reader of the code that there is no grouping going on. References #35166.
* | Merge pull request #35411 from rails/pass-locals-to-templateAaron Patterson2019-02-267-55/+46
|\ \ | | | | | | Pass locals in to the template object on construction
| * | Remove unused method / fix documentationAaron Patterson2019-02-261-6/+1
| | |
| * | Update actionview/lib/action_view/template/resolver.rbJohn Hawthorn2019-02-261-1/+1
| | | | | | | | | Co-Authored-By: tenderlove <tenderlove@github.com>
| * | `original_encoding` isn't used, so deprecate it and remove the ivarAaron Patterson2019-02-252-5/+5
| | |
| * | Expand key word args for ActionView::TemplateAaron Patterson2019-02-252-4/+4
| | |
| * | Don't mutate `virtual_path`, remove `decorate`Aaron Patterson2019-02-252-17/+4
| | | | | | | | | | | | | | | | | | `virtual_path` is calculated in the constructor when the Template object is allocated. We don't actually need to set it in the `decorate` method. That means we can remove the decorate method all together.
| * | Pass locals in to the template object on constructionAaron Patterson2019-02-256-26/+35
| | | | | | | | | | | | | | | | | | | | | This commit ensures that locals are passed in to the template objects when they are constructed, then removes the `locals=` mutator on the template object. This means we don't need to mutate Template objects with locals in the `decorate` method.
* | | [ci skip] Renamed formats -> format in test after #35406Abhay Nikam2019-02-261-1/+1
|/ /
* | Merge pull request #35408 from rails/template-has-one-variantAaron Patterson2019-02-253-13/+11
|\ \ | | | | | | Template has one variant
| * | Change `variants` to `variant`Aaron Patterson2019-02-252-11/+10
| | | | | | | | | | | | | | | | | | Templates only have one variant, so we should not store it in an array. This commit converts `variants` to `variant` and deprecates the plural accessor
| * | Remove potential `variants` mutation in `decorate`Aaron Patterson2019-02-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even if the template is constructed with a `nil` variant, the array it constructs will never be `empty?`: https://github.com/rails/rails/blob/56b030605b4d968077a4ddb96b4ab619e75fb999/actionview/lib/action_view/template.rb#L152 We get an array that is `[nil]`, which is not empty, so this conditional is never true.
| * | Convert `variant` to a keyword argAaron Patterson2019-02-251-2/+2
| | |
* | | Preparing for 6.0.0.beta2 releaseRafael Mendonça França2019-02-253-2/+4
| | |
* | | Improve Template#inspect output (#35407)John Hawthorn2019-02-252-2/+16
|/ / | | | | | | | | | | | | | | | | | | | | | | | | * Don't call inspect from identifier_method_name * Add locals Template#inspect Handler, formats, and variant are usually obvious from looking at the identifier. However it's not uncommon to have different locals for the same template so we should make that obvious in inspect. * Add tests for short_identifier and inspect [John Hawthorn + Rafael Mendonça França]
* | Templates have one formatAaron Patterson2019-02-2515-29/+41
| | | | | | | | | | | | | | Templates only have one format. Before this commit, templates would be constructed with a single element array that contained the format. This commit eliminates the single element array and just implements a `format` method. This saves one array allocation per template.
* | Update actionview/lib/action_view/template.rbRyuta Kamizono2019-02-251-1/+1
| | | | | | Co-Authored-By: tenderlove <tenderlove@github.com>
* | remove the formats writer on templatesAaron Patterson2019-02-251-2/+6
| |
* | Dereference the format type before template constructionAaron Patterson2019-02-252-2/+2
| | | | | | | | | | The format should always be exactly one symbol. Now we don't need to check whether or not the format is a `Type` in the constructor.
* | Always pass a format to the ActionView::Template constructorAaron Patterson2019-02-255-12/+25
| | | | | | | | | | This means we can eliminate nil checks and remove some mutations from the `decorate` method.
* | Add a finalizer to inline templatesAaron Patterson2019-02-223-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a finalizer just to inline templates. We can't cache compilation of inline templates because it's possible that people could have render calls that look like this: ```ruby loop do render inline: "#{rand}" end ``` and we would cache every one of these different inline templates. That would cause a memory leak. OTOH, we don't need finalizers on regular templates because we can cache, control, and detect changes to the template source. Fixes: #35372
* | Merge pull request #35371 from rails/always-have-a-formatAaron Patterson2019-02-224-7/+18
|\ \ | | | | | | Ensure that rendered templates always have a format
| * | Ensure that rendered templates always have a formatAaron Patterson2019-02-224-7/+18
| | | | | | | | | | | | | | | This removes one call to `lookup_context` and also eliminates a conditional in `_render_template`.
* | | Merge pull request #35369 from rails/fewer-lookup-context-callsAaron Patterson2019-02-222-6/+6
|\ \ \ | | | | | | | | Pass lookup context to the layout handlers
| * | | Pass lookup context to the layout handlersAaron Patterson2019-02-222-6/+6
| |/ / | | | | | | | | | | | | | | | | | | I want to start reducing the calls to `lookup_context`. That method caches the lookup context in an ivar, but I would like to cache the lookup context on the stack. That way we aren't coupled to the behavior of the `lookup_context` method.
* / / Prefer I18n.with_localeGeorge Claghorn2019-02-212-52/+37
|/ /
* | [ci skip] actionview typo fixes.alkesh262019-02-212-2/+2
| |
* | Deprecate ActionView::PathSet as argument to ActionView::Base.newCliff Pruitt2019-02-202-0/+6
| | | | | | | | Currently, `ActionView::Base.new` will raise a `NotImplementedError` when given an instance of `ActionView::PathSet` on initialization. This commit prevents the raised error in favor of a deprecation warning.
* | Deprecate LookupContext#rendered_formatAaron Patterson2019-02-193-7/+21
| | | | | | | | | | We no longer depend on `rendered_format` side effects, so we can remove this method now. 🎉
* | Fix up styleAaron Patterson2019-02-194-8/+8
| |
* | Return rendered template information instead of just stringsAaron Patterson2019-02-197-31/+92
| | | | | | | | | | | | | | | | | | | | | | | | This commit introduces "rendered template" and "rendered collection" objects. The template renderers can now return a more complex object than just strings. This allows the framework to get more information about the templates that were rendered. In this commit we use the rendered template object to set the "rendered_format" on the lookup context in the controller rather than all the way in the template renderer. That means we don't need to check the "rendered_format" every time we render a template, we just do it once after all templates have been rendered.
* | Move inline rendering content-type test to a controller testAaron Patterson2019-02-192-5/+11
| | | | | | | | | | | | This commit is to remove direct access to the "rendered_format" attribute on the lookup context. "rendered_format" is an implementation detail that we shouldn't test directly.
* | Add a test that writes to the collection cacheAaron Patterson2019-02-191-1/+8
| |
* | rename push / pop functionAaron Patterson2019-02-192-2/+2
| |
* | Merge pull request #35293 from rails/remove-rendered-format-from-cacheAaron Patterson2019-02-199-33/+33
|\ \ | | | | | | Pass the template format to the digestor