aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/base.rb
Commit message (Collapse)AuthorAgeFilesLines
* Convert to class_attributeJeremy Kemper2010-02-011-1/+2
|
* For performance reasons, you can no longer call html_safe! on Strings. ↵Yehuda Katz2010-01-311-1/+1
| | | | | | | | | | | | Instead, all Strings are always not html_safe?. Instead, you can get a SafeBuffer from a String by calling #html_safe, which will SafeBuffer.new(self). * Additionally, instead of doing concat("</form>".html_safe), you can do safe_concat("</form>"), which will skip both the flag set, and the flag check. * For the first pass, I converted virtually all #html_safe!s to #html_safe, and the tests pass. A further optimization would be to try to use #safe_concat as much as possible, reducing the performance impact if we know up front that a String is safe.
* Improve missing template error messages a little bit.José Valim2010-01-311-6/+11
|
* Fix t('.helper').José Valim2010-01-261-2/+4
|
* Make @controller an internal ivar in the viewJoshua Peek2010-01-221-8/+6
|
* Silence warningsMikel Lindsaar2010-01-021-0/+1
|
* Reorganize autoloads:Carlhuda2009-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | * A new module (ActiveSupport::Autoload) is provide that extends autoloading with new behavior. * All autoloads in modules that have extended ActiveSupport::Autoload will be eagerly required in threadsafe environments * Autoloads can optionally leave off the path if the path is the same as full_constant_name.underscore * It is possible to specify that a group of autoloads live under an additional path. For instance, all of ActionDispatch's middlewares are ActionDispatch::MiddlewareName, but they live under "action_dispatch/middlewares/middleware_name" * It is possible to specify that a group of autoloads are all found at the same path. For instance, a number of exceptions might all be declared there. * One consequence of this is that testing-related constants are not autoloaded. To get the testing helpers for a given component, require "component_name/test_case". For instance, "action_controller/test_case". * test_help.rb, which is automatically required by a Rails application's test helper, requires the test_case.rb for all active components, so this change will not be disruptive in existing or new applications.
* Extracted localized_cache.rb from ActionController, added it to ↵José Valim2009-11-011-2/+2
| | | | AbstractController and made ActionMailer use it.
* Change config implementation in AV slightlyYehuda Katz2009-10-151-1/+10
|
* Make this less brittle and work on 1.8Yehuda Katz2009-10-151-9/+9
|
* Add a read-only method which plugin authors can use to determine if xss ↵Michael Koziarski2009-10-151-0/+5
| | | | | | | escaping. This doesn't provide a way to turn off the escaping, but alternative template engine authors can figure out what their default should be by calling this. Avoids a messy version + plugin check.
* Start adding configuration to ActionView instead of using constants.Yehuda Katz2009-10-141-1/+1
| | | | | | | By using config rather than hardcoded constants, we can evolve the configuration system over time (we'd just need to update the config method with more robust capabilities and all consumers would get the capabilities with no code changes)
* Get rid of constant name usage for stack trace help in favor of overriding ↵Yehuda Katz2009-10-091-9/+9
| | | | #inspect and .name.
* Fix warning spew for 1.9Carl Lerche2009-10-081-1/+5
|
* Switch to on-by-default XSS escaping for rails.Michael Koziarski2009-10-081-1/+1
| | | | | | | | | | | | This consists of: * String#html_safe! a method to mark a string as 'safe' * ActionView::SafeBuffer a string subclass which escapes anything unsafe which is concatenated to it * Calls to String#html_safe! throughout the rails helpers * a 'raw' helper which lets you concatenate trusted HTML from non-safety-aware sources (e.g. presantized strings in the DB) * New ERB implementation based on erubis which uses a SafeBuffer instead of a String Hat tip to Django for the inspiration.
* Not calling a private method anymoreYehuda Katz2009-10-071-2/+5
|
* Fix warning spewYehuda Katz2009-10-061-1/+3
|
* Got tests to pass with some more changes.Yehuda Katz2009-08-151-1/+12
| | | | | | | | | | | | | | | | * request.formats is much simpler now * For XHRs or Accept headers with a single item, we use the Accept header * For other requests, we use params[:format] or fallback to HTML * This is primarily to work around the fact that browsers provide completely broken Accept headers, so we have to whitelist the few cases we can specifically isolate and treat other requests as coming from the browser * For APIs, we can support single-item Accept headers, which disambiguates from the browsers * Requests to an action that only has an XML template from the browser will no longer find the template. This worked previously because most browsers provide a catch-all */*, but this was mostly accidental behavior. If you want to serve XML, either use the :xml format in links, or explicitly specify the XML template: render "template.xml".
* Clean up ActionView some:Yehuda Katz2009-08-151-16/+0
| | | | | | | | | | * Call _evaluate_assigns_and_ivars at the two entry points so we don't have to do a check at every render. * Make template.render viable without having to go through a wrapper method * Remove old TemplateHandler#render(template, local_assigns) path so we don't have to set self.template every time we render a template. * Move Template rescuing code to Template#render so it gets caught every time. * Pull in some tests from Pratik that test render @object in ActionView
* Experimental: Improve performance of ActionView by preventing method cache ↵Yehuda Katz2009-08-091-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | flushing due to runtime Kernel#extend: * The helper module adds a new _helper_serial property onto AbstractController subclasses * When #helper is used to add helpers to a class, the serial number is updated * An ActionView subclass is created and cached based on this serial number. * That subclass includes the helper module from the controller * Subsequent requests using the same controller with the same serial will result in reusing that subclass, rather than being forced to take an action (like include or extend) that will result in a global method cache flush on MRI and a flush of the entire AV class' cache on JRuby. * For now, this optimization is not applied to the RJS helpers, which results in a global method cache flush in MRI and a flush of the JavaScriptGenerator class in JRuby only when using RJS. * Since the effects are limited to using RJS, and would only affect JavaScriptGenerator in JRuby (as opposed to the entire view object), it seems worthwhile to apply this now. * This resulted in a significant performance improvement. I will have benchmarks in the next day or two that show the performance impact of the last several commits. * There is a small chance this could break existing code (although I'm not sure how). If that happens, please report it immediately.
* Cache controller_path on the AV instance to avoid needing to make additional ↵Yehuda Katz2009-08-091-1/+3
| | | | calls back into the controller for each attempt (this was done because these calls were adding up significantly in partial rendering and showing up on profiles)
* Rendering a template from ActionView will default to looking for partials ↵Yehuda Katz2009-08-091-1/+1
| | | | | | | | | only in the current mime type. * The old behavior was tested only as a side-effect of a different test--the original tests remain; a new template in the XML mime was added. * If you are relying on the current behavior and object to this change, please participate in http://groups.google.com/group/rubyonrails-core/browse_thread/thread/6ef25f3c108389bd
* Rename find_by_parts and find_by_parts? to find and exists?Yehuda Katz2009-08-071-1/+1
|
* Separate ActionView::Context so something else can easily be made into an AV ↵Yehuda Katz2009-07-191-6/+1
| | | | context
* Simplify required "ActionView compliant" APIYehuda Katz2009-07-191-0/+6
|
* Minor ActionView cleanupYehuda Katz + Carl Lerche2009-06-181-5/+4
|
* Drive the final stake through @content_for_*'s heart!Yehuda Katz + Carl Lerche2009-06-171-1/+3
|
* Cleaning up if defined?(ActionController::Http) blocks from the pre new base ↵Yehuda Katz + Carl Lerche2009-06-171-38/+14
| | | | era.
* Fixing pending tests and fixed some formats / partial rendering semanticsYehuda Katz + Carl Lerche2009-06-171-0/+2
|
* Added the :rjs render optionYehuda Katz + Carl Lerche2009-05-211-8/+9
|
* Remove some response content type concepts from ActionViewYehuda Katz + Carl Lerche2009-05-211-2/+5
|
* Cherry-pick core extensionsJeremy Kemper2009-05-131-0/+3
|
* Deprecate template, session, assigns, and layout accessors on response ↵Joshua Peek2009-04-281-1/+1
| | | | object. Instead access them through the controller instance. This mainly affects functional test assertions.
* Refactor ActionView::TemplateYehuda Katz + Carl Lerche2009-04-271-1/+3
| | | | | | | | ActionView::Template is now completely independent from template storage, which allows different back ends such as the database. ActionView::Template's only responsibility is to take in the template source (passed in from ActionView::Path), compile it, and render it.
* Bring abstract_controller up to date with rails/masterCarl Lerche & Yehuda Katz2009-04-131-2/+31
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolved all the conflicts since 2.3.0 -> HEAD. Following is a list of commits that could not be applied cleanly or are obviated with the abstract_controller refactor. They all need to be revisited to ensure that fixes made in 2.3 do not reappear in 3.0: 2259ecf368e6a6715966f69216e3ee86bf1a82a7 AR not available * This will be reimplemented with ActionORM or equivalent 06182ea02e92afad579998aa80144588e8865ac3 implicitly rendering a js response should not use the default layout [#1844 state:resolved] * This will be handled generically 893e9eb99504705419ad6edac14d00e71cef5f12 Improve view rendering performance in development mode and reinstate template recompiling in production [#1909 state:resolved] * We will need to reimplement rails-dev-boost on top of the refactor; the changes here are very implementation specific and cannot be cleanly applied. The following commits are implicated: 199e750d46c04970b5e7684998d09405648ecbd4 3942cb406e1d5db0ac00e03153809cc8dc4cc4db f8ea9f85d4f1e3e6f3b5d895bef6b013aa4b0690 e3b166aab37ddc2fbab030b146eb61713b91bf55 ae9f258e03c9fd5088da12c1c6cd216cc89a01f7 44423126c6f6133a1d9cf1d0832b527e8711d40f 0cb020b4d6d838025859bd60fb8151c8e21b8e84 workaround for picking layouts based on wrong view_paths [#1974 state:resolved] * The specifics of this commit no longer apply. Since it is a two-line commit, we will reimplement this change. 8c5cc66a831aadb159f3daaffa4208064c30af0e make action_controller/layouts pick templates from the current instance's view_paths instead of the class view_paths [#1974 state:resolved] * This does not apply at all. It should be trivial to apply the feature to the reimplemented ActionController::Base. 87e8b162463f13bd50d27398f020769460a770e3 fix HTML fallback for explicit templates [#2052 state:resolved] * There were a number of patches related to this that simply compounded each other. Basically none of them apply cleanly, and the underlying issue needs to be revisited. After discussing the underlying problem with Koz, we will defer these fixes for further discussion.
| * pluginize concurrent block body partJeremy Kemper2009-03-191-2/+2
| |
| * Body parts: future rendering, threaded future, queued future, open-uri exampleJeremy Kemper2009-03-131-2/+8
| |
| * Change naming to match 2.2 so life is easier on plugin developersJeremy Kemper2009-03-121-5/+5
| |
| * Eliminate internal render stack since we only need its head and tailJeremy Kemper2009-03-121-2/+16
| |
| * Use Array.wrap() instead of Array() and handle ↵Pratik Naik2009-02-281-1/+1
| | | | | | | | action_view.cache_template_loading being false
| * Ensure the old behaviour is retained when action_view.cache_template_loading ↵Pratik Naik2009-02-281-3/+3
| | | | | | | | is not set explicitly
| * Fix templates reloading in development when using custom view path [#2012 ↵Joshua Peek2009-02-191-2/+2
| | | | | | | | state:resolved]
| * Port fast reloadable templates from rails-dev-boost.thedarkone2009-02-121-3/+10
| |
| * Improve view rendering performance in development mode and reinstate ↵Andrew White2009-02-091-2/+6
| | | | | | | | | | | | template recompiling in production [#1909 state:resolved] Signed-off-by: Joshua Peek <josh@joshpeek.com>
* | Updated old AC::Base for small changes to AVYehuda Katz and Carl Lerche2009-04-081-1/+2
| |
* | Merge commit 'rails/3-0-unstable'Yehuda Katz2009-01-301-80/+9
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: actionpack/lib/action_controller/base.rb actionpack/lib/action_dispatch/http/mime_type.rb actionpack/lib/action_dispatch/http/request.rb actionpack/lib/action_view/base.rb actionpack/lib/action_view/paths.rb actionpack/test/controller/session/cookie_store_test.rb actionpack/test/dispatch/rack_test.rb actionpack/test/dispatch/request_test.rb
| * | Begin unifying the interface between ActionController and ActionViewYehuda Katz2009-01-221-81/+10
| |/
| * Clean up view path cruft and split path implementations into Template::Path ↵Joshua Peek2008-12-291-1/+1
| | | | | | | | and Template::EagerPath
* | Clean up view path cruft and split path implementations into Template::Path ↵Joshua Peek2009-01-011-1/+1
| | | | | | | | and Template::EagerPath
* | Initial work to merge several places with similar logicYehuda Katz2008-12-251-1/+1
|/