| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
[#3467 state:resolved]
Signed-off-by: Eloy Duran <eloy.de.enige@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
state:resolved]
The test case now mimicks the template environment more closely, so it's
possible to use render, load helper dependencies.
This also fixes assert_select, and similar assertions. Because view tests
and helpers generally don't render full templates assert_select looks
first in rendered and then in output_buffer to find the rendered output.
Additional `master'-only changes: Made the Action Pack Rakefile run the
ActionView::TestCase tests, and made ActionView::Rendering#_render_text
always return a string.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Move #set_cookie and #delete_cookie inline to optimize. These optimizations should
almost certainly be sent back upstream to Rack. The optimization involves using
an ivar for cookies instead of indexing into the headers each time.
* Was able to use a bare Hash for headers now that cookies have their own joining
semantics (some code assumed that the raw cookies were an Array).
* Cache blankness of body on body=
* Improve expand_cache_key for Arrays of a single element (common in our case)
* Use a simple layout condition check unless conditions are used
* Cache visible actions
* Lazily load the UrlRewriter
* Make etag an ivar that is set on prepare!
|
|
|
|
|
|
|
|
|
|
| |
in a collection in half.
To discuss: What are the desired semantics (if any) for layouts in a collection. There are no
tests for it at present, and I'm not sure if it's needed at all.
Deprecated on this branch: `object` pointing at the current object in partials. You can still
use the partial name, or use :as to achieve the same thing. This is obviously up for discussion.
|
|
|
|
|
|
|
|
|
|
| |
in with render
* _render_single_template, which renders a template without layout
* _render_partial_unknown_type, which renders a partial of unknown type
(the entry method for most partial rendering; supports strings, objects, and collections)
* _render_partial_object, which renders a partial for a single object.
* extracted _render_partial_path so it can be used to render the spacer without going
through the public render :partial
|
|
|
|
| |
is optional
|
| |
|
| |
|
| |
|
|
|
|
| |
object. Instead access them through the controller instance. This mainly affects functional test assertions.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
alias_method_chain :process either.
|
| |
|
|
|
|
| |
Signed-off-by: Joshua Peek <josh@joshpeek.com>
|
|
|
|
| |
Signed-off-by: Joshua Peek <josh@joshpeek.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
but it has since been removed from 1.9.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Conflicts:
actionpack/test/controller/layout_test.rb
|
| |
|
|
|
|
| |
the instance variable so others can override the methods.
|
|
|
|
| |
class in setup if it hasn't been already.
|
|
|