Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Require action_view to fix missing constant | Philipe Fatio | 2014-02-07 | 1 | -0/+1 |
| | | | | | Previously, requiring action_view/view_paths did cause an uninitialized constant error for ENCODING_FLAG, which is defined in action_view. | ||||
* | Move the null mime type to request.format | Carlos Antonio da Silva | 2013-12-23 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TLDR: always return an object that responds to the query methods from request.format, and do not touch Mime::Type[] lookup to avoid bugs. --- Long version: The initial issue was about being able to do checks like request.format.html? for request with an unknown format, where request.format would be nil. This is where the issue came from at first in #7837 and #8085 (merged in cba05887dc3b56a46a9fe2779b6b228880b49622), but the implementation went down the path of adding this to the mime type lookup logic. This unfortunately introduced subtle bugs, for instance in the merged commit a test related to send_file had to be changed to accomodate the introduction of the NullType. Later another bug was found in #13064, related to the content-type being shown as #<Mime::NullType:...> for templates with localized extensions but no format included. This one was fixed in #13133, merged in 43962d6ec50f918c9970bd3cd4b6ee5c7f7426ed. Besides that, custom handlers were not receiving the proper template formats anymore when passing through the rendering process, because of the NullType addition. That was found while migrating an application from 3.2 to 4.0 that uses the Markerb gem (a custom handler that generates both text and html emails from a markdown template). --- This changes the implementation moving away from returning this null object from the mime lookup, and still fixes the initial issue where request.format.zomg? would raise an exception for unknown formats due to request.format being nil. | ||||
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2013-12-20 | 1 | -1/+1 |
|\ | |||||
| * | Typos. return -> returns. [ci skip] | Lauro Caetano | 2013-12-03 | 1 | -1/+1 |
| | | |||||
* | | Require action_view explicitly in AC::Base | Łukasz Strzałkowski | 2013-12-08 | 1 | -0/+1 |
| | | |||||
* | | Retain ActionPack dependency on ActionView | Łukasz Strzałkowski | 2013-12-05 | 1 | -0/+1 |
| | | |||||
* | | Action Pack Variants | Łukasz Strzałkowski | 2013-12-04 | 1 | -0/+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. | ||||
* | calculate the ivars to remove in advance as a set and cache them in a | Aaron Patterson | 2013-11-06 | 1 | -8/+2 |
| | | | | | | | constant. `view_assigns` can use the precalculated sets and remove instance variables without allocating any extra arrays | ||||
* | use a set and reject to avoid array allocations | Aaron Patterson | 2013-11-06 | 1 | -4/+11 |
| | |||||
* | each_with_object on the view_assigns hash | Aaron Patterson | 2013-11-06 | 1 | -3/+1 |
| | |||||
* | use slice to avoid range allocation | Aaron Patterson | 2013-11-06 | 1 | -1/+3 |
| | |||||
* | these variables are also private | Aaron Patterson | 2013-11-06 | 1 | -0/+1 |
| | |||||
* | instance_variables returns symbols, so we should use symbols in our list | Aaron Patterson | 2013-11-06 | 1 | -1/+1 |
| | |||||
* | Make AC standalone rendering work | Santiago Pastorino | 2013-09-10 | 1 | -2/+5 |
| | |||||
* | Remove BasicRendering tests | José Valim | 2013-09-09 | 1 | -9/+1 |
| | |||||
* | Remove remaining coupling with AV in MimeResponds | José Valim | 2013-09-09 | 1 | -0/+7 |
| | |||||
* | Remove BasicRendering and remove template functionality from AbsC::Rendering | José Valim | 2013-09-09 | 1 | -31/+12 |
| | |||||
* | Move BasicRendering to AbstractController | Łukasz Strzałkowski | 2013-09-03 | 1 | -0/+28 |
| | |||||
* | Make Mime::TEXT default format in AbstractController | Łukasz Strzałkowski | 2013-09-03 | 1 | -0/+1 |
| | |||||
* | Move skeleton methods from AV to AbsC | Łukasz Strzałkowski | 2013-09-03 | 1 | -7/+19 |
| | | | | | | | | | | The methods: * #render_to_body * #render_to_string * #_normalize_render Haven't had anything specyfic to ActionView. This was common code which should belong to AbstractController | ||||
* | Return to using protected_instance_variables in AV | Łukasz Strzałkowski | 2013-09-02 | 1 | -5/+6 |
| | |||||
* | Revert "Port all remaining self.protected_instance_variables to class methods" | Łukasz Strzałkowski | 2013-09-02 | 1 | -5/+11 |
| | | | | This reverts commit 7de994fa215e9f4c2856d85034bc4dd7b65d0c01. | ||||
* | Port all remaining self.protected_instance_variables to class methods | Łukasz Strzałkowski | 2013-08-29 | 1 | -11/+5 |
| | |||||
* | Add #rendered_format method to controllers | Łukasz Strzałkowski | 2013-08-25 | 1 | -0/+5 |
| | |||||
* | Improve AV::Rendering docs | Łukasz Strzałkowski | 2013-08-25 | 1 | -0/+3 |
| | |||||
* | Code formatting & typo fixes | Łukasz Strzałkowski | 2013-08-25 | 1 | -1/+1 |
| | |||||
* | Move protected_instance_variables & view_assigns to AbstractController | Łukasz Strzałkowski | 2013-08-25 | 1 | -1/+20 |
| | |||||
* | Create AbstractController::Rendering interface | Łukasz Strzałkowski | 2013-08-25 | 1 | -0/+50 |
| | | | | This interface should be use when implementing renderers. | ||||
* | Revert "Rename abstract_controller/rendering. to errors.rb" | Łukasz Strzałkowski | 2013-08-25 | 1 | -0/+9 |
| | | | | This reverts commit 6fe91ec5008838338e54ab8570f7c95ee0cdd8e8. | ||||
* | Rename abstract_controller/rendering. to errors.rb | Łukasz Strzałkowski | 2013-08-25 | 1 | -9/+0 |
| | | | | Since all rendering stuff was extracted to AV, the only thing that left was single class with error so file name wasn't relevant anymore | ||||
* | Move rendering from AP to AV | Łukasz Strzałkowski | 2013-08-25 | 1 | -187/+0 |
| | |||||
* | Fix typos in AP: "overriden" => "overridden" | Carlos Antonio da Silva | 2013-03-30 | 1 | -1/+1 |
| | |||||
* | Fixed grammar | Anupam Choudhury | 2013-03-28 | 1 | -1/+1 |
| | |||||
* | Improve docs for AbsC::Rendering | José Valim | 2013-02-27 | 1 | -3/+11 |
| | |||||
* | cleanup, remove trailing whitespace within actionpack | Yves Senn | 2012-10-27 | 1 | -1/+1 |
| | |||||
* | remove AV.prepare and move all helper-related logic into the controller. ↵ | Nick Sutterer | 2012-06-29 | 1 | -3/+13 |
| | | | | | | this decouples the view since it no longer knows about routes internals. this is a result of an ongoing discussion at https://github.com/rails/rails/pull/6826. | ||||
* | Merge pull request #5480 from drogus/rendering-issues | José Valim | 2012-03-17 | 1 | -0/+1 |
| | | | | Fix for #5440 | ||||
* | Symbol#[] method presents in Ruby 1.9 | Sergey Nartimov | 2012-01-07 | 1 | -1/+1 |
| | |||||
* | get rid of using instance_variable_names method from AS | Sergey Nartimov | 2012-01-07 | 1 | -6/+5 |
| | | | | | - instance_variables return symbols in 1.9 - there is instance_variable_defined? method | ||||
* | Remove unecessary config_accessors. | José Valim | 2011-12-24 | 1 | -7/+1 |
| | |||||
* | Some small optimizations and improvements to benchmark code. | José Valim | 2011-12-08 | 1 | -6/+1 |
| | |||||
* | TestCase should respect the view_assigns API instead of pulling variables on ↵ | José Valim | 2011-10-02 | 1 | -2/+2 |
| | | | | its own. | ||||
* | More updates to ivars list. | José Valim | 2011-05-06 | 1 | -1/+1 |
| | |||||
* | Move variables to underscore format, update protected instance variables list. | José Valim | 2011-05-06 | 1 | -6/+22 |
| | |||||
* | More AV::Base cleanup. | José Valim | 2011-05-04 | 1 | -15/+3 |
| | |||||
* | Move prefixes to view paths as they are now a lookup context dependency. | José Valim | 2011-05-04 | 1 | -21/+0 |
| | |||||
* | no @controller dependency in Renderers. | Nick Sutterer | 2011-05-04 | 1 | -1/+1 |
| | |||||
* | Add a shared entry point for AV and AC render which can be used as extension ↵ | José Valim | 2011-05-03 | 1 | -5/+1 |
| | | | | in the future. | ||||
* | Introduce view renderer. | José Valim | 2011-05-01 | 1 | -2/+11 |
| | |||||
* | Do not inherit from Rack::Response, remove a shit-ton of unused code. | José Valim | 2011-04-19 | 1 | -7/+1 |
| |