rwz/nestive — pull request #11 by CyborgMaster (2013-10-18 20:03:16+00:00)
Title: Extending Partials

I love Nestive and how it allows me to really make my html templates DRY. I wanted to apply the same modularity to partials. I have a few partials that are extremely similar (Content types that each need a slightly different editor) and so I wanted to leverage nestive inheritance.

However it doesn't work. It appears that there is only one nestive context per view render or something, because both partials end up with the same content.

I have a setup similar to this:

``` erb
Parent partial: _parent.html.erb

Shared Content...
<%= yield %>

Child 1: _child1.html.erb
<%= extends "_parent" do %>
Child 1 Content
<% end %>

Child 2: _child2.html.erb
<%= extends "_parent" do %>
Child 2 Content
<% end %>

Main view: show.html.erb
<%= render 'child1' %>
<%= render 'child2' %>
```

The partials work, but I get the same content out of both of them as follows:
``` html

Shared Content...
Child 1 Content

Shared Content...
Child 1 Content

```

I haven't delved into the nestive code to try and figure out why yet (although I hope to find to do that today) but I thought I would ask for help here first.

Is this a use case that nestive can handle? If not can we extend it somehow to make it work?