| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| | |
Conflicts:
actionpack/lib/abstract_controller/base.rb
|
| |
| |
| |
| |
| |
| | |
[#4784 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|/ |
|
| |
|
|
|
|
|
|
| |
state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|
|
|
| |
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|
|
|
|
|
|
|
|
| |
More work still needs to be done on some of these names
(render_template.action_view and render_template!.action_view particularly)
but this allows (for example) /^sql/ to subscribe to all
the various ORMs without further modification
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
| |
memory leaks in dev mode
|
| |
|
|\ |
|
| |
| |
| |
| | |
find_template instead of find in views.
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
activerecord/lib/active_record/base.rb
railties/lib/rails/configuration.rb
railties/lib/rails/log_subscriber.rb
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
lookup.
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
available, so we need to tell that we are simply rendering a collection.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
be optimized.
|
|
|
|
| |
partial instrumentation easier).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consequences:
* It is not possible to always pre-determine the layout before going to ActionView.
This was *already* broken for render :partial => @object, :layout => true. This is
now handled by overriding render_to_body in layouts.rb and manually injecting the
partial's response. This needs to be done in ActionController since ActionController
knows enough to get _layout_for_option. There is probably a better abstraction here.
* As a result, all partial rendering can correctly restrict their layouts to the mime
type of the rendered partial. This could have previously caused a bug in some edge cases.
* If other layout-like options are added, they might need to add special code for the
case of render :partial. We should try to think of an alternate solution, if possible,
but this works for the cases we know of now.
|
|
|
|
| |
* TODO: Review ActionController calling render_template for certain partials.
Might we be able to save logic by always delegating to AV's render_partial?
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
* rename _render_partial to _render_partial_unknown_type to reflect that for this call,
we don't know the type.
* Merge _render_partial_with_block and _render_partial_with_layout to _render_partial
* TODO: Check to see if any more logic can be shared
* TODO: See about streamlining block path so we can get rid of @_proc_for_layout
* Remove @exempt_from_layout as it is no longer needed
|
|
|
|
| |
is optional
|
|
|
|
|
| |
* remove no longer used _array_like_objects
* _render_content_with_layout renamed to _render_content since layout it optional
* remove check for optional layout before _render_content
|
| |
|