aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/base.rb
Commit message (Collapse)AuthorAgeFilesLines
* Rename `ActionView::Base#run` to `#_run`Seb Jacobs2019-03-151-1/+1
| | | | | | | | | | | | | | | | | | 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
* Squish the deprecation messages across the codebasePrathamesh Sonpatki2019-03-111-3/+3
| | | | | | | | | | | | | | | | Sample example -> Before: prathamesh@Prathameshs-MacBook-Pro-2 blog *$ rails server thin DEPRECATION WARNING: Passing the Rack server name as a regular argument is deprecated and will be removed in the next Rails version. Please, use the -u option instead. After: prathamesh@Prathameshs-MacBook-Pro-2 squish_app *$ rails server thin DEPRECATION WARNING: Passing the Rack server name as a regular argument is deprecated and will be removed in the next Rails version. Please, use the -u option instead.
* [ci skip] actionview typo fixes.alkesh262019-02-211-1/+1
|
* Deprecate ActionView::PathSet as argument to ActionView::Base.newCliff Pruitt2019-02-201-0/+2
| | | | 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.
* rename push / pop functionAaron Patterson2019-02-191-1/+1
|
* Merge pull request #35293 from rails/remove-rendered-format-from-cacheAaron Patterson2019-02-191-3/+5
|\ | | | | Pass the template format to the digestor
| * Pass the template format to the digestorAaron Patterson2019-02-151-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Show deprecated message instead of raise exception in ↵yuuji.yaginuma2019-02-161-5/+9
|/ | | | | | | | | | | | | `compiled_method_container` method Since #35036, the subclasses of `ActionView::Base` requires the `compiled_method_container`. This is incompatible. For example, `web-console` use view class that subclass of `ActionView::Base`, and does not work it now cause of this. Actually, since it seems that it is only `ActionView::Base` that `compiled_method_container` is necessary, modified the condition that emits a warning.
* Address to useless assignment `formats = nil` after #35254Ryuta Kamizono2019-02-141-3/+1
| | | | https://codeclimate.com/github/rails/rails/pull/35254
* Clean for fix done in #35229. Removed unused argumentsAbhay Nikam2019-02-131-2/+2
|
* Turn lookup context in to a stack, push and pop if formats changeAaron Patterson2019-02-111-14/+40
| | | | | | | | | | | 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
* Fix some typos!Aaron Patterson2019-02-061-1/+1
|
* Add a message to help allocate AV::Base instancesAaron Patterson2019-02-061-1/+5
|
* Pull generated methods up in to the anonymous subclassAaron Patterson2019-02-061-5/+6
| | | | Then we don't need the extra module.
* Regenerate AV::Base subclass when DetailsKey gets clearedAaron Patterson2019-02-061-1/+6
|
* Move templates to an anonymous subclass of AV::BaseAaron Patterson2019-02-061-7/+9
| | | | | Now we can throw away the subclass and the generated methods will get GC'd too
* add tests to make sure deprecated API is still supportedAaron Patterson2019-01-311-2/+4
|
* Tighten up the AV::Base constructorAaron Patterson2019-01-291-9/+42
| | | | | | | | | | | | | | | 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.
* Ask the view for its method containerAaron Patterson2019-01-181-0/+4
| | | | | | Rather than doing is_a? checks, ask the view object for its compiled method container. This gives us the power to replace the method container depending on the instance of the view.
* Directly include "CompiledTemplates" moduleAaron Patterson2019-01-181-0/+6
| | | | | We always want to include this module. It'll be used in production (maybe)
* Pull up virtual path assignmentAaron Patterson2019-01-161-2/+2
|
* Pull buffer assignment upAaron Patterson2019-01-161-0/+1
| | | | | Since everything goes through a `run` method, we can pull the buffer assignment up.
* Always evaluate views against an ActionView::BaseAaron Patterson2019-01-161-0/+7
| | | | | Methods created by views should always be evaluated against an AV::Base instance. This way we can extract and refactor things in to classes.
* [Action View] require_relative => requireAkira Matsuda2017-10-211-5/+5
| | | | This basically reverts c4d1a4efeec6f0b5b58222993aa0bec85a19b6a8
* Use frozen string literal in actionview/Kir Shatrov2017-07-241-0/+2
|
* [Action View] require => require_relativeAkira Matsuda2017-07-011-5/+5
|
* Use a hash to record every partial's cache hit status instead of sharing a ↵Stan Lo2017-06-081-0/+1
| | | | boolean.
* Use mattr_accessor default: option throughout the projectGenadi Samokovarov2017-06-031-10/+5
|
* Change ActionView ERB Handler from Erubis to ErubiJeremy Evans2017-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Add three new rubocop rulesRafael Mendonça França2016-08-161-1/+1
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* modernizes hash syntax in actionviewXavier Noria2016-08-061-3/+3
|
* applies new string literal convention in actionview/libXavier Noria2016-08-061-9/+9
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* [ci skip] Update formatting in ActionView::Base documentationAlex Kitchens2016-06-291-6/+6
|
* Fix usage of word alternatively in docs [ci skip]Abhishek Jain2015-10-061-1/+1
|
* Make disable_with default in submit_tagJustin Schiff2015-08-111-0/+4
| | | | | | | | | | | | | | Prevents double submission by making disable_with the default. Default disable_with option will only be applied if user has not specified her/his own disable_with option, whether that is in the `data-disable-with` string form or the `:data => { :disable_with => "Saving..." }` hash form. disable_with will default to the value attribute. A configuration option was added to opt out of this functionality if the user so desires. `config.action_view.automatically_disable_submit_tag = false`
* Add documentation for local_assigns [ci skip]Nithin Bekal2015-02-171-0/+8
|
* Fix link in documentation. [ci skip]Igor Zubkov2014-11-301-2/+2
|
* Explain ERB space removal. [ci skip]Ciro Santilli2014-09-111-1/+3
|
* Shorten ActionView::Base doc summary line. [ci skip]Ciro Santilli2014-09-021-3/+4
|
* Clarify Rails uses erubis not stdlin ERB. [ci skip]Ciro Santilli2014-09-021-1/+2
|
* defined? should actually work in current implementationAkira Matsuda2014-08-071-9/+0
| | | | So this trick is not needed to be documented anymore.
* Builder source code is still available on github [ci skip]Zachary Scott2014-06-131-0/+3
| | | | This was also removed from #15542
* remove rubyforge.org that was shut down [ci skip]Gaurav Sharma2014-06-061-2/+0
|
* Rails config for raise on missing translationsKassio Borges2014-01-271-0/+4
| | | | | Add a config to setup whether raise exception for missing translation or not.
* Remove deprecated cattr_* requiresGenadi Samokovarov2013-12-031-1/+1
|
* Add missing requires inside AVŁukasz Strzałkowski2013-08-251-0/+4
|
* Move actionpack/lib/action_view* into actionview/libPiotr Sarnacki2013-06-201-0/+201