rails/actionview
John Hawthorn e53c45b80c Introduce Resolver::PathParser
The template resolver is supposed to determine the handler, format, and
variant from the path in extract_handler_and_format_and_variant.

Previously this behaviour was close but didn't exactly match the
behaviour of finding templates, and in some cases (particularly with
handlers or formats missing) would return incorrect results.

This commit introduces Resolver::PathParser, a class which should be
able to accurately from any path inside a view directory be able to tell
us exactly the prefix, partial, variant, locale, format, variant, and
handler of that template.

This works by building a building a regexp from the known handlers and
file types. This requires that any resolvers have their cache cleared
when new handlers or types are registered (this was already somewhat the
requirement, since resolver lookups are cached, but this makes it
necessary in more situations).
2020-05-19 18:55:10 -07:00
..
app/assets/javascripts Check that request is same-origin prior to including CSRF token in XHRs 2020-05-15 16:15:00 -07:00
bin Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
lib Introduce Resolver::PathParser 2020-05-19 18:55:10 -07:00
test Introduce Resolver::PathParser 2020-05-19 18:55:10 -07:00
.gitignore Clean up and consolidate .gitignores 2018-02-17 14:26:19 -08:00
actionview.gemspec Update the Rails mailing list URLs to new discuss discourse URL [ci skip] 2020-04-02 22:00:28 +05:30
blade.yml Add rails-ujs to Action View 2016-11-26 01:23:07 -05:00
CHANGELOG.md Unify raise_on_missing_translations for views and controllers 2020-05-20 02:42:59 +03:00
coffeelint.json Test rails-ujs in our travis matrix 2017-02-22 13:49:28 -05:00
MIT-LICENSE Bump license years from 2019 to 2020 [ci skip] 2020-01-01 15:10:31 +05:30
package.json update package.json files to use https homepage value 2019-10-02 12:00:11 +02:00
Rakefile Load framework test files in deterministic order 2019-12-16 16:55:06 +00:00
README.rdoc Update the Rails mailing list URLs to new discuss discourse URL [ci skip] 2020-04-02 22:00:28 +05:30
RUNNING_UJS_TESTS.rdoc Fix typos and add a few suggestions 2017-11-28 19:27:43 +01:00
RUNNING_UNIT_TESTS.rdoc Fix typos and add a few suggestions 2017-11-28 19:27:43 +01:00

= Action View

Action View is a framework for handling view template lookup and rendering, and provides
view helpers that assist when building HTML forms, Atom feeds and more.
Template formats that Action View handles are ERB (embedded Ruby, typically
used to inline short Ruby snippets inside HTML), and XML Builder.

You can read more about Action View in the {Action View Overview}[https://edgeguides.rubyonrails.org/action_view_overview.html] guide.

== Download and installation

The latest version of Action View can be installed with RubyGems:

  $ gem install actionview

Source code can be downloaded as part of the Rails project on GitHub:

* https://github.com/rails/rails/tree/master/actionview


== License

Action View is released under the MIT license:

* https://opensource.org/licenses/MIT


== Support

API documentation is at

* https://api.rubyonrails.org

Bug reports for the Ruby on Rails project can be filed here:

* https://github.com/rails/rails/issues

Feature requests should be discussed on the rails-core mailing list here:

* https://discuss.rubyonrails.org/c/rubyonrails-core