aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | WIP: Errors in logs should show log tags as well.Vipul A M2016-02-122-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Changed formatted_code_for to return array of logs to be tagged for each line - Changed some render tests to match new behaviour of return Fixes #22979
* | | | Test to check if the data-attr if nil is same or notSourav Moitra2016-02-142-0/+7
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | if data attribute is nil it is ignored if value is nil the pair is ignored if value is nil it is skipped Improved test for data attr nil
* | | Fix grammar `a` to `an` [ci skip]Ryuta Kamizono2016-02-131-1/+1
| |/ |/|
* | push kwargs up to the user facing APIAaron Patterson2016-02-123-13/+13
| | | | | | | | | | | | | | this lets us leverage Ruby's kwarg handling (exceptions for missing params, etc) ASAP which allows us to skip active support method calls and make sure the exception stack is closer to where the user called the methods.
* | Prefer empty? to any?.Kasper Timm Hansen2016-02-121-1/+1
| | | | | | | | | | | | | | If the collection isn't empty any? will loop through it. Spare the loop and be more concise with what we're asking the collection about.
* | Stop mutating return value.Kasper Timm Hansen2016-02-121-2/+3
| | | | | | | | | | | | `PartialRenderer.render_collection_with/without_template` returns an array of rendered partials. Avoid dup'ing and shifting it by indexing into the collection instead.
* | Inline `fetch_or_cache_partial`.Kasper Timm Hansen2016-02-121-10/+6
| | | | | | | | Wasn't pulling its weight for a simple yield anymore.
* | Write to collection cache where the template is rendered.Kasper Timm Hansen2016-02-122-9/+15
| | | | | | | | | | | | | | | | Moves us closer to having access to a local template variable, we can ask for eligibility and its virtual_path. Currently we rely on `@template`, which we don't have available when rendering collections without a fixed template.
* | Only write to collection cache if we have a callable cache key.Kasper Timm Hansen2016-02-121-1/+5
| | | | | | | | | | | | | | | | | | | | | | A callable cache key writes to the collection cache under a certain namespace. Which means if we don't have scoped cache key we can just rely on the `cache model_name do` in the templates to cache them. Less writes, more sharing. Add `assert_customer_cached` to better illustrate this in tests, and remove tests which then don't communicate as much.
* | Remove useless callable_cache_key? check.Kasper Timm Hansen2016-02-121-2/+1
| | | | | | | | | | | | `automatic_cache_eligible?´ is only called if there was no `:cache` key to fetch in the `@options` via `cache_collection?`. So the check will always be false.
* | the lookup context looks in the cwd, so prefix isn't necessaryAaron Patterson2016-02-121-2/+1
| |
* | use a real LookupContext in the digest testsAaron Patterson2016-02-121-28/+6
| | | | | | | | | | This will ensure that the digestor stays in parity with the LookupContext object.
* | Remove single_template_render? method.Kasper Timm Hansen2016-02-121-5/+1
| | | | | | | | | | | | Written when I didn't understand the internals as well. Action View generally just refers to `@template` when meaning a fixed template render. So follow that implicit convention.
* | Don't search in locals for cache_options.Kasper Timm Hansen2016-02-121-3/+1
| | | | | | | | | | | | We should only support a top level `cache_options`. We also don't have to default the options to a hash as Active Support's cache defaults that arg to nil.
* | use assert_not_equal so there will be better error messagesAaron Patterson2016-02-121-1/+1
| | | | | | | | in the case of failure it is nice to see what the two digests are.
* | use kwargs to avoid hash slicingAaron Patterson2016-02-121-3/+3
|/ | | | | we can use kwargs in this case to avoid values_at and except calls on the options hash
* remove detail initialization metaprogrammingAaron Patterson2016-02-111-8/+12
| | | | | | This metaprogrammed method doesn't seem to be a bottleneck, so lets just use a regular method so it's easier to understand. We can follow up with more interesting techniques for cache manipulation soon.
* Don't capture the MissingTemplate exception.Kasper Timm Hansen2016-02-111-1/+1
| | | | Wasn't removed in 57ac777.
* Oops. :cut:Aaron Patterson2016-02-111-6/+0
|
* follow indentation rulesAaron Patterson2016-02-111-5/+11
|
* make the logger method always return somethingAaron Patterson2016-02-111-4/+9
| | | | then we can stop scattering nil checks (e.g. `try`) through the class.
* sort templates after looking them up in the from the paths cacheAaron Patterson2016-02-101-4/+4
| | | | | | | | | | | | | | The view paths cache will eventually query the filesystem when looking up templates: https://github.com/rails/rails/blob/2db347bebc9d3f39b3c5e274b7c9beecfce73913/actionview/lib/action_view/template/resolver.rb#L224-L230 The order in which files are returned is file system dependent. Since the template digest [depends on its children](https://github.com/rails/rails/blob/2db347bebc9d3f39b3c5e274b7c9beecfce73913/actionview/lib/action_view/digestor.rb#L109-L115), the order of the dependencies will impact the fingerprint. This commit sorts the wildcard dependencies so that we get a consistent hash. Fixes #23592
* check `supports_view_paths?` at registration timeAaron Patterson2016-02-101-7/+9
| | | | | | | | | If we check the conditional at registration time, then we can avoid the conditional at runtime. This commit checks for view path support when the handler is registered so that runtime calls to `find_dependencies` won't need to check the conditional. The idea is that `register_tracker` is called only once where `find_dependencies` may be called many times.
* Merge pull request #22772 from gsamokovarov/nack-template-errorDavid Heinemeier Hansson2016-02-101-0/+4
|\ | | | | Fix edge case with ActionView::Template::Error reraise
| * Fix edge case with ActionView::Template::Error reraiseGenadi Samokovarov2015-12-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When you re-raise an ActionView::Template::Error, the #cause can change. You can see this behaviour with [nack]. Currently, `web-console` doesn't run the console in the proper binding in the case of errors in the views, because when we follow the `#cause` of the exception it is an [`EOFError`][EOFError]. This also affects [pow] as it runs on [nack]. [nack]: https://github.com/josh/nack [pow]: http://pow.cx/ [EOFError]: https://github.com/josh/nack/blob/d523cc870c0a11dcf349388a15adfecba9314f97/lib/nack/server.rb#L108
* | Add some Action Cable CHANGELOG entriesRafael Mendonça França2016-02-011-3/+0
| | | | | | | | | | | | And improve changelongs. [ci skip]
* | Preparing for Rails 5.0.0.beta2Sean Griffin2016-02-012-1/+6
| |
* | Wrangle the asset build into something that sounds more generalMatthew Draper2016-02-011-0/+3
| |
* | Slice out options for cache_fragment_name explicitlyRyan Bigg2016-01-281-1/+2
| | | | | | | | This allows expire_in (and other options) to be passed to the cache method
* | Add tests to #23288Rafael Mendonça França2016-01-271-0/+1
| |
* | Fix img alt attribute generation when using Sprockets >= 3.0Bart de Water2016-01-272-1/+6
| |
* | Fix doc [ci skip]Daniel Gomez de Souza2016-01-271-1/+1
| |
* | Fix sanitizer testsJon Moss2016-01-261-3/+3
| | | | | | | | | | These tests were failing due to backwards incompatible changes, as apart of the v1.0.3 release of rails-html-sanitizer.
* | Merge branch '5-0-beta-sec'Aaron Patterson2016-01-258-16/+56
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 5-0-beta-sec: bumping version fix version update task to deal with .beta1.1 Eliminate instance level writers for class accessors allow :file to be outside rails root, but anything else must be inside the rails view directory Don't short-circuit reject_if proc stop caching mime types globally use secure string comparisons for basic auth username / password
| * | bumping versionAaron Patterson2016-01-251-1/+1
| | |
| * | allow :file to be outside rails root, but anything else must be inside the ↵Aaron Patterson2016-01-227-15/+55
| | | | | | | | | | | | | | | | | | rails view directory CVE-2016-0752
* | | html_safe is not supposed to be public API for AV. This change removes usage ↵Vipul A M2016-01-2012-43/+43
| | | | | | | | | | | | | | | | | | of html_safe in favour of raw() in AV helpers. Also changed usage of html_safe to make use of raw() instead so that the intended behaviour is verified with raw()
* | | Remove ActionView dependence on ActionPack's Mime implementationJon Moss2016-01-174-4/+4
| | |
* | | Store the symbols as an array.Kasper Timm Hansen2016-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A Set can't be implicitly converted into an Array: ``` irb(main):012:0> formats = [ :rss ] => [:rss] irb(main):013:0> formats &= SET.symbols TypeError: no implicit conversion of Set into Array from (irb):13:in `&' from (irb):13 from /Users/kasperhansen/.rbenv/versions/2.2.3/bin/irb:11:in `<main>' ``` Besides `Mime::SET.symbols` returns an Array, so we're closer to that.
* | | Enrich the SET constant to respond to symbols.Kasper Timm Hansen2016-01-171-1/+5
| | | | | | | | | | | | Match `Mime::SET.symbols`.
* | | Don't bother looking up the types.Kasper Timm Hansen2016-01-171-3/+3
| | | | | | | | | | | | If they aren't symbols, then they aren't likely to be in the set anyway.
* | | Replace class attribute with SET constant.Kasper Timm Hansen2016-01-171-3/+2
| | | | | | | | | | | | We'll be using this to map over to Action Dispatch's Mime::Set.
* | | Remove register abstraction.Kasper Timm Hansen2016-01-171-7/+1
| | | | | | | | | | | | | | | The template types is a private abstraction to fill in basic blanks from Action Dispatch's mime types. As such we can modify the data structure ourselves.
* | | Replace delegate calls with standard method defs.Kasper Timm Hansen2016-01-171-1/+4
| | | | | | | | | | | | | | | | | | Spares a to_sym call by aliasing to_sym to ref. Then the delegate felt meager for one method; ditch and define method ourselves.
* | | Spare to_sym call in `==`.Kasper Timm Hansen2016-01-171-2/+1
| | | | | | | | | | | | | | | | | | | | | The @symbol has already been converted to a symbol in initialize, so no need to call to_sym when comparing it. Ditch early return for a simple unless statement.
* | | Make ref return the internal symbol.Kasper Timm Hansen2016-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | We delegate to_sym to the internal symbol, which we've already called to_sym on in initialize, so we don't need to do that. We also know to_sym will never return a falsy value, so we'll never hit to_s. Just return the symbolized symbol.
* | | Merge pull request #20046 from yoongkang/ladidaRafael Mendonça França2016-01-163-1/+20
|\ \ \ | | | | | | | | | | | | Use ActiveSupport::SafeBuffer when flushing content_for
| * | | Use ActiveSupport::SafeBuffer when flushing content_forYoong Kang Lim2015-05-253-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, when content_for is flushed, the content was replaced directly by a new value in ActionView::OutputFlow#set. The problem is this new value passed to the method may not be an instance of ActiveSupport::SafeBuffer. This change forces the value to be set to a new instance of ActiveSupport::SafeBuffer.
* | | | docs, formatting pass over changelogs. [ci skip]Yves Senn2016-01-131-1/+1
| | | |
* | | | Merge pull request #20638 from jaimeiniesta/locale-aware-pluralize-helperKasper Timm Hansen2016-01-102-17/+36
|\ \ \ \ | | | | | | | | | | Pass the current locale to Inflector from the pluralize text helper.