aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/lookup_context_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix the resolver cache and stop mutating the lookup_contextRafael Mendonça França2014-03-141-13/+0
| | | | | Before we had a bug in the resolver cache so the disable_cache were not working when passing options to find
* Introduce #with_formats_and_variants to prevent problems with mutating ↵Łukasz Strzałkowski2014-03-141-0/+13
| | | | finder object
* Ensure LookupContext in Digestor selects correct variantPiotr Chmolowski2014-03-091-0/+14
| | | | | | | | | | Related to: #14242 #14243 14293 Variants passed to LookupContext#find() seem to be ignored, so I've used the setter instead: `finder.variants = [ variant ]`. I've also added some more test cases for variants. Hopefully this time passing tests will mean it actually works.
* Action Pack VariantsŁukasz Strzałkowski2013-12-041-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* `ActionView::MissingTemplate` for partials includes underscore.Yves Senn2013-12-021-2/+2
| | | | | | Missing partial folder/_partial instead of folder/partial. Closes #13002.
* Fix AV tests, I18nProxy was moved to AVŁukasz Strzałkowski2013-08-251-1/+1
|
* Move template tests from actionpack to actionviewPiotr Sarnacki2013-06-201-0/+263