-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't remove yield p = np
from a specific partial.
#38
Comments
yield p = np
from a partial.yield p = np
from a specific partial.
I'm thinking of adding <%= render 'account/shared/title' do |cp| %>
<% cp.relay :title, :actions %>
<% end %> # partial.relay :title, :description
def relay(*names)
contents.merge! parent.contents.slice(*names)
end Or we could do something from the outer side? <%= partial.forward(:title, :actions).render 'account/shared/title' %>
<%= partial.(:title, :actions).render 'account/shared/title' %> # Define call on Partial and Ruby lets you call it like this. |
@kaspth I think Looking at the code in the partial that breaks, I added some debug statements like so: <% puts p.content_for(:title) # => "The Testing Team’s Dashboard" %>
<%= render 'account/shared/title' do |cp| %>
<% puts p.content_for(:title) # => nil %>
<% cp.content_for :title, p.content_for(:title) %>
<% cp.content_for :actions, p.content_for(:actions) %>
<% end %>
<%= render 'account/shared/notices' %>
<div class="space-y-8 py-4 xl:py-8 xl:px-8">
<%= p.yield :body %>
</div> The fact that |
You can see in bullet-train-co/bullet_train-themes-light#27 that I'm basically successful removing all the
yield p = np
calls in these theme library.However, there is one that breaks: bullet-train-co/bullet_train-themes-light@771c315
My guess is that this happens because it's testing another nice partial, but referencing the parent partial context within the block of the other one. That's the only thing I can think of.
Steps to reproduce:
bin/setup
,bin/dev
, etc.)bin/develop
and select thebullet_train-themes-light
Ruby gem.local/bullet_train-themes-light
.app/views/themes/light/_page.html.erb
<% yield p = np %>
This is what the app looks like when this bug is triggered:
The text was updated successfully, but these errors were encountered: