aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/railtie.rb
Commit message (Collapse)AuthorAgeFilesLines
* Only clear template caches in dev after changes (#35629)John Hawthorn2019-04-011-1/+1
|
* Deprecate finalizer configuration (it doesn't do anything)Aaron Patterson2019-02-061-0/+13
| | | | | | Revert "Remove finalizer and configuration" This reverts commit 9e7b4a3173788ea43b11e74a4d2f69a5f1565daa.
* Remove finalizer and configurationAaron Patterson2019-02-061-8/+0
|
* Add `action_view.finalize_compiled_template_methods` config optionSimon Coffey2018-04-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | ActionView::Template instances compile their source to methods on the ActionView::CompiledTemplates module. To prevent leaks in development mode, where templates can frequently change, a finalizer is added that undefines these methods[1] when the templates are garbage-collected. This is undesirable in the test environment, however, as templates don't change during the life of the test. Moreover, the cost of undefining a method is proportional to the number of descendants a class or module has, since the method cache must be cleared for all descendant classes. As ActionView::CompiledTemplates is mixed into every ActionView::TestCase (or in RSpec suites, every view spec example group), it can end up with a very large number of descendants, and undefining its methods can become very expensive. In large test suites, this results in a long delay at the end of the test suite as all template finalizers are run, only for the process to then exit. To avoid this unnecessary cost, this change adds a config option, `action_view.finalize_compiled_template_methods`, defaulting to true, and sets it to false in the test environment only. [1] https://github.com/rails/rails/blob/09b2348f7fc8d4e7191e70e06608c5909067e2aa/actionview/lib/action_view/template.rb#L118-L126
* Don't enforce UTF-8 by defaultAndrew White2018-02-271-0/+10
| | | | | | With the disabling of TLS 1.0 by most major websites, continuing to run IE8 or lower becomes increasingly difficult so default to not enforcing UTF-8 encoding as it's not relevant to other browsers.
* Make form_with_generates_ids default in Rails 5.2Rafael Mendonça França2017-11-251-3/+1
| | | | | When the defaults being loaded are the 5.0 or 5.1 we disable generation of ids with form_with.
* Change `form_with` to generates ids by defaultnpezza932017-11-251-0/+9
| | | | | | | | | | When `form_with` was introduced we disabled the automatic generation of ids that was enabled in `form_for`. This usually is not an good idea since labels don't work when the input doesn't have an id and it made harder to test with Capybara. You can still disable the automatic generation of ids setting `config.action_view.form_with_generates_ids` to `false.`
* Use frozen string literal in actionview/Kir Shatrov2017-07-241-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Set to `form_with_generates_remote_forms` only when config is explicitly ↵yuuji.yaginuma2017-04-221-2/+4
| | | | | | | | | specified Without this check, even if config is not specified, `ActionView::Helpers::FormHelper.form_with_generates_remote_forms` always be set to nil and remote form not be generated. Follow up to 128b804c6ce40fcbde744f294f8cb98654f6efec
* Configure form_with_generates_remote_forms in its own initializerRafael Mendonça França2017-04-211-0/+7
| | | | | | | | | This configuration is not present in ActionView::Base so we can't let the action_view.set_configs initializer set it. Also add tests to make sure this config works. Fixes #28824
* Default embed_authenticity_token_in_remote_forms to nil.Kasper Timm Hansen2017-04-161-1/+1
| | | | | | | Effectively treat nil values as "auto", e.g. whatever a form helper chooses to interpret it as. But treat an explicitly assigned false value as disabling.
* Fixed usage of cache_template_loadingMax Melentiev2016-12-061-1/+1
| | | | It disables recompilation of templates on every request in test env.
* Convert ActionView::Railtie into EngineGuillermo Iguaran2016-11-261-1/+1
|
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-1/+1
|
* Avoid bumping the class serial when invoking executorMatthew Draper2016-10-031-1/+1
|
* Replace middleware with executor callback.Kasper Timm Hansen2016-05-161-1/+1
| | | | | | | | | | | | | Per request digest caches were added before we had hooks into different units of work that Rails performs. As such the most reliable way to prevent stale cache digests was with a middleware. The middleware prevented staleness in Action Controller requests. However, the executor is superior because it should also prevent staleness when running just Active Job jobs or broadcasting through Action Cable's server.
* Push action_view.collection_caching to be called towards the end, since it ↵Vipul A M2016-04-281-4/+4
| | | | | | | depends on being called after action_controller.set_configs. This causes, other AV initializers after it to be called after all of AC initializers, which get pulled in before since action_controller.set_configs gets called. Hence, push initializer depending on after hook, to be called after all initializers for this railtie are done.
* Respect gospel of Railties Gods: no on_load with after.Kasper Timm Hansen2016-04-271-3/+1
| | | | | | We don't need no stinking `on_load` where we're going! Because people far wiser than me (@rafaelfranca and @jeremy) know that passing `:after` means the lib is already loaded.
* make the collection_caching initializer run after the Action Controller ↵Lachlan Sylvester2016-04-271-1/+1
| | | | configs are setup
* Rename dependencies.rake to cache_digests.rakeDharam Gollapudi2016-03-091-1/+1
| | | | | | | As the tasks are related to cache_digests and as they are already namespaced under cache_digests, renaming to cache_digests.rake makes it to know where to find these tasks.
* debug_missing_translation configuration added to action_viewSameer Rahmani2015-12-181-0/+1
| | | | | | | | | `I18n.translate` helper will wrap the missing translation keys in a <span> tag only if `debug_missing_translation` configuration has a truthy value. Default value is `true`. For example in `application.rb`: # in order to turn off missing key wrapping config.action_view.debug_missing_translation = false
* Make digest cache work in development.Kasper Timm Hansen2015-07-181-0/+8
| | | | | | Avoid computing the same fragment digest many times when looping over templates. The cache is cleared on every request so template changes are still picked up.
* Exclude cache_digests:dependencies rake task in api appJorge Bejar2015-06-111-2/+4
|
* Merge multi_fetch_fragments.Kasper Timm Hansen2015-02-201-0/+6
| | | | | | | | Makes caching a collection of template partials faster using `read_multi` on the Rails cache store. Some caching implementations have optimized `read_multi` so we don't have to check in the cache store for every template.
* Use public Module#include, in favor of https://bugs.ruby-lang.org/issues/8846robertomiranda2015-01-311-1/+1
| | | | ref: https://github.com/rails/rails/pull/18763#issuecomment-72349769
* Remove the explicit order set for the initializerRafael Mendonça França2013-12-051-1/+1
| | | | | | | This will fix the regression added on b068e20b35797aa6deaa377a48c990759734f515. See tests added at ff08d31 to a better understanding about the problem
* Include AV::Layouts directly in AM::BaseŁukasz Strzałkowski2013-12-051-6/+0
| | | | No need to do this in railtie as AM depends on AV either way
* Retain ActionPack dependency on ActionViewŁukasz Strzałkowski2013-12-051-1/+0
|
* Adds template dependencies rake task from cache_digests gem.Thomas von Deyen2013-09-261-0/+4
| | | | This adds the rake tasks `cache_digests:dependencies` and `cache_digests:nested_dependencies` from `cache_digests` gem.
* Do not load AV inside APŁukasz Strzałkowski2013-08-251-0/+1
| | | | Move that part to AV railtie
* Revert "Move setting content_type to AV"Łukasz Strzałkowski2013-08-251-1/+1
| | | | This reverts commit f4d602aff6cec80304b131ecfcc2676d0304f0cc.
* Move setting content_type to AVŁukasz Strzałkowski2013-08-251-1/+1
|
* Include AV::Layouts before setting view_pathsŁukasz Strzałkowski2013-08-251-2/+2
|
* Load AV::Layout to AM::Base in railtiesŁukasz Strzałkowski2013-08-251-0/+6
|
* Load AV::Layouts dynamicly via railtiesŁukasz Strzałkowski2013-08-251-1/+1
|
* Remove abstract_controller load hooksŁukasz Strzałkowski2013-08-251-4/+0
|
* Hook up AV::Rendering on AV intializationŁukasz Strzałkowski2013-08-251-1/+5
|
* Move layouts to AVŁukasz Strzałkowski2013-08-251-0/+6
|
* Move actionpack/lib/action_view* into actionview/libPiotr Sarnacki2013-06-201-0/+39