Closed hbaragar closed 9 years ago
I think this is related: if you add the following before the <a...>...</a>
<unless:children>
Empty Message
</unless:children>
it prints out Empty Message
when there are no records in the collection, but it does not when put after the <a...>...</a>
.
Thanks Henry for the nice bug description. I remember seeing something similar before, something to do with some instance variable being set and thus printing that extra card.
I think this commit fixed this issue: https://github.com/Hobo/hobo/commit/bbc6e9b92ab42711e51f036a569acd5ef56da28d
I will close it for now. @hbaragar , feel free to reopen it if it's still happening!
Warm regards, Ignacio
I want the
<new-link>
for a child collection to precede the collection on the<show-page>
of the parent. However, this has the effect of creating two "empty" cards and suppressing the<empty-message>
and<else>
tags.To recreate the problem:
children :children
directive to the parent modelauto_actions_for :parent, [:new, :create]
directive to the child controllerapp/views/parents/show.dryml
file with the following contents:rails s
, create a parent record and see the two "empty" cards on the parent show page.Note that using
<after-collection-heading:>
exhibits the same problem. I don't know of any work-arounds.I have found that the
action="new"
andif="&can_create?(@parent.children)" param="new-link"
attributes each cause one of the "blank" cards to be created.