Created
April 11, 2012 21:27
-
-
Save justinfrench/2362758 to your computer and use it in GitHub Desktop.
Nestive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Expected h1 title for posts#show is "My Blog :: My Post Title" | |
# -------------------------------------------------------------- | |
# This was how it worked with `layout nil` in the controller | |
# | |
# posts_controller.rb | |
class PostsController | |
layout nil | |
end | |
# app/views/posts/show.html.erb | |
<% extends :blog %> | |
<% append :title, " :: My Post Title" %> | |
<% end %> | |
# app/views/layouts/blog.html.erb | |
<% extends :application %> | |
<% replace :title, "My Blog" %> | |
<% end %> | |
# app/views/layouts/application.html.erb | |
<h1><% area :title, "My Site" %></h1> | |
# -------------------------------------------------------------- | |
# This was how it worked with controller layouts | |
# | |
# posts_controller.rb | |
class PostsController | |
layout "blog" | |
end | |
# app/views/posts/show.html.erb | |
# change: removed the extend block | |
<% append :title, " :: My Post Title" %> | |
# app/views/layouts/blog.html.erb | |
# no change | |
<% extends :application %> | |
<% replace :title, "My Blog" %> | |
<% end %> | |
# app/views/layouts/application.html.erb | |
# no change | |
<h1><% area :title, "My Site" %></h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment