Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix extending a blank view

Fixes #9
  • Loading branch information...
commit 7e8e9dc609faf788632974a2ffe62f1a9bd7dcd8 1 parent 68b9d46
@rwz authored
View
2  lib/nestive/layout_helper.rb
@@ -89,7 +89,7 @@ def extends(layout, &block)
layout = "layouts/#{layout}" unless layout.include?('/')
# Capture the content to be placed inside the extended layout
- content_for(:layout).replace capture(&block)
+ @view_flow.get(:layout).replace capture(&block)
render :file => layout
end
View
4 spec/controllers/nestive_spec.rb
@@ -78,6 +78,10 @@
assert_select '#some-area', 'extended: two'
assert_select 'h2', 'extended: one'
end
+
+ it 'extends empty layout' do
+ get :extended_three
+ end
end
end
View
4 spec/internal/app/controllers/nestive_controller.rb
@@ -6,4 +6,8 @@ def extended_one
def extended_two
render :layout => 'extend_two'
end
+
+ def extended_three
+ render :layout => 'extend_one'
+ end
end
View
1  spec/internal/app/views/nestive/extended_three.html.erb
@@ -0,0 +1 @@
+<% append :title, 'lol' %>
Please sign in to comment.
Something went wrong with that request. Please try again.