| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* The approach is to compile <% %> into a method call that checks whether
the value returned from a block is a String. If it is, it concats to the buffer and
prints a deprecation warning.
* <%= %> uses exactly the same logic to compile the template, which first checks
to see whether it's compiling a block.
* This should have no impact on other uses of block in templates. For instance, in
<% [1,2,3].each do |i| %><%= i %><% end %>, the call to each returns an Array,
not a String, so the result is not concatenated
* In two cases (#capture and #cache), a String can be returned that should *never*
be concatenated. We have temporarily created a String subclass called NonConcattingString
which behaves (and is serialized) identically to String, but is not concatenated
by the code that handles deprecated <% %> block helpers. Once we remove support
for <% %> block helpers, we can remove NonConcattingString.
|
|
|
|
| |
collection renderings.
|
|
|
|
| |
controller (so plugins and/or controllers can overwrite just one method).
|
|
|
|
| |
find_template instead of find in views.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
lookup.
|
|
|
|
| |
Signed-off-by: wycats <wycats@gmail.com>
|
|
|
|
| |
plugins) can override details_for_render in their controllers and add appropriate additional details. Now if only they could *do* something with those details...
|
|
|
|
|
|
| |
[#3856 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
|
|
|
|
| |
available, so we need to tell that we are simply rendering a collection.
|
|
|
|
| |
in AM (like in AP#process_action) and remove locale instrumentation.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
rendering which comes from ActionController.
|
|
|
|
| |
ActionController::Base#log_event, so everything can be logged within one listener. Also expose log_process_action as a hook for different modules to include their own information during the action processing. This allow ActiveRecord to hook and any other ORM. Finally, this commit changes 'Processing' and 'Rendering' in logs to 'Processed' and 'Rendered' because at the point it's logged, everying already happened.
|
| |
|
| |
|
|
|
|
| |
be optimized.
|
|
|
|
| |
partial instrumentation easier).
|
| |
|
| |
|
|
|
|
|
|
| |
return value is the block's content.
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
|
| |
|
| |
|
|
|
|
| |
generation
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
| |
|
|
|
|
| |
architecture is kind of messy. Next: CLEAN UP.
|
|
|
|
|
|
|
|
| |
* only one of partial_name or :as will be available as a local
* `object` is removed
* Simplify _layout_for in most cases.
* Remove <% render :partial do |args| %>
* <% render :partial do %> still works fine
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
single block ivar
|
| |
|