aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/testing
Commit message (Collapse)AuthorAgeFilesLines
* Fix deprecation warning about variants and formatsPrathamesh Sonpatki2019-04-041-2/+2
| | | | | | - After https://github.com/rails/rails/pull/35408 and https://github.com/rails/rails/pull/35406, the `formats` and `variants` methods are deprecated in favor of `format` and `variant`.
* Fix checking for template variants when using the ActionView::FixtureResolverEdward Rudd2019-04-031-0/+10
|
* Remove query_format argument from resolverJohn Hawthorn2019-02-261-1/+1
|
* Create templates with format=nilJohn Hawthorn2019-02-261-1/+1
|
* Templates have one formatAaron Patterson2019-02-252-2/+2
| | | | | | | 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.
* Use frozen string literal in actionview/Kir Shatrov2017-07-242-0/+4
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-022-2/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-012-0/+2
|
* remove redundant curlies from hash argumentsXavier Noria2016-08-062-3/+3
|
* modernizes hash syntax in actionviewXavier Noria2016-08-062-3/+3
|
* applies new string literal convention in actionview/testXavier Noria2016-08-062-2/+2
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Action Pack VariantsŁukasz Strzałkowski2013-12-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, variants in the templates will be picked up if a variant is set and there's a match. The format will be: app/views/projects/show.html.erb app/views/projects/show.html+tablet.erb app/views/projects/show.html+phone.erb If request.variant = :tablet is set, we'll automatically be rendering the html+tablet template. In the controller, we can also tailer to the variants with this syntax: class ProjectsController < ActionController::Base def show respond_to do |format| format.html do |html| @stars = @project.stars html.tablet { @notifications = @project.notifications } html.phone { @chat_heads = @project.chat_heads } end format.js format.atom end end end The variant itself is nil by default, but can be set in before filters, like so: class ApplicationController < ActionController::Base before_action do if request.user_agent =~ /iPad/ request.variant = :tablet end end end This is modeled loosely on custom mime types, but it's specifically not intended to be used together. If you're going to make a custom mime type, you don't need a variant. Variants are for variations on a single mime types.
* Move template tests from actionpack to actionviewPiotr Sarnacki2013-06-202-0/+30