Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Create templates with format=nil | John Hawthorn | 2019-02-26 | 1 | -1/+1 |
| | |||||
* | Templates have one format | Aaron Patterson | 2019-02-25 | 1 | -1/+1 |
| | | | | | | | 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 Shatrov | 2017-07-24 | 1 | -0/+2 |
| | |||||
* | Revert "Merge pull request #29540 from kirs/rubocop-frozen-string" | Matthew Draper | 2017-07-02 | 1 | -1/+0 |
| | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa. | ||||
* | Enforce frozen string in Rubocop | Kir Shatrov | 2017-07-01 | 1 | -0/+1 |
| | |||||
* | remove redundant curlies from hash arguments | Xavier Noria | 2016-08-06 | 1 | -2/+2 |
| | |||||
* | modernizes hash syntax in actionview | Xavier Noria | 2016-08-06 | 1 | -2/+2 |
| | |||||
* | applies new string literal convention in actionview/test | Xavier Noria | 2016-08-06 | 1 | -1/+1 |
| | | | | | 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łkowski | 2013-12-04 | 1 | -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 actionview | Piotr Sarnacki | 2013-06-20 | 1 | -0/+18 |