This project is archived and is in readonly mode.
render(:inline) in a layout before yield replaces original content
-
Rohit Arondekar
- Tag set to rails 3, actionview, render
- Assigned user set to José Valim
Confirmed on Rails master, Ruby 1.9.2-head.
According to the edge api docs => http://edgeapi.rubyonrails.org/classes/ActionView/Rendering.html#M0...
:inline - Renders an inline template similar to how it‘s done in the controller.
-
José Valim
- Milestone cleared.
-
Neeraj Singh
- Tag changed from rails 3, actionview, render to rails 3, actionview, patch, render
Attached is patch with test.
-
Rohit Arondekar
+1 applies cleanly, tests pass on the following Rubies:
- ruby 1.8.7 (2009-06-12 patchlevel 174)
- ruby 1.9.2dev (2010-06-06 revision 28184)
-
Paul Barry
+1, applies cleanly, resolves the issue
-
José Valim
The tests may pass, but it's not the correct fix because we should not use the identifier for the purpose above and it's a special check for a given template type. I will discuss with Yehuda a bit more and follow up soon, but a more acceptable solution would be to only set the layout if a layout object exists:
@_content_for[:layout] = content if layout (only set the content for layout if there is a layout)Neeraj, could you try this solution and see if all tests still pass?
-
Neeraj Singh
Attached is modified patch (and same test) based on feedback by José .
-
Rohit Arondekar
Applies cleanly and the tests pass on 1.8.7 and 1.9.2-head.
-
Repository
- State changed from new to resolved
(from [e574ca920d315158a4af5c906b23ea0082c5690f]) render(:inline) in a layout before yield replaces original content
[#4777 render(:inline) in a layout before yield replaces original content state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/e574ca920d315158a4af5c906b23ea...
