Open firedev opened 9 years ago
@view_flow.get(:layout).replace capture(&block)
TypeError: no implicit conversion of nil into String
capture(&block)
returns nil
, but the block is correct
block.call
=> [:menus]
So, I don't yet have a solution or an understanding of what precisely is going on, but I have found that I can "fix" this problem by ensuring there are newlines at the end of the block. So, for your example, try this:
<%= extends :application do %>
<% purge :menus %>
<% end %>
Interesting. Could you a write a spec reproducing the problem?
I'll try to take a look later today. I think I have an idea what might be going on there and what would be the easiest way to fix it.
I found a simple solution: capture(&block).to_s
It seems that the way the log works, when you initially capture the &block
, nothing has been rendered yet, so it is nil
. It is only after the file has been rendered (a few lines later) that things start to happen.
I can definitely write a spec to reproduce tho.
Is it solved? I have the same problem @fractaledmind pointed. (Rails 5.1 btw)
This causes TypeError. no implicit conversion of nil into String
<%= extends :app do %>
<%= replace :content do %>
<div class="main main-raised">
<%= flash_messages %>
<div class="flash"></div>
<div class="container">
<%= yield %>
</div>
</div>
<% end %>
<% end %>
This works:
<%= extends :app do %>
<%= replace :content do %>
<div class="main main-raised">
<%= flash_messages %>
<div class="flash"></div>
<div class="container">
<%= yield %>
</div>
</div>
<% end %>
<% end %>
Just tried to use nestive with Rails 4.2, here is a sample admin.html.erb:
It blows up with