You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thinking about the need/addition of a handle_none slot hook that would handle the fallback for collection like we use to with partial rendering.
Maybe there's already a way to handle this cleanly, I'd love to hear how you guys are handling this without the if/else in view.
# current implementation# in viewif@products.size.zero?renderProduct::EmptyComponent.newelserenderProductComponent.with_collection(@products,user: current_user)end
# proposed solution# in viewrenderProductComponent.with_collection(@products,user: current_user)# inside product_component.rbrenders_none:none,EmptyComponent
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Thinking about the need/addition of a
handle_none
slot hook that would handle the fallback for collection like we use to with partial rendering.Maybe there's already a way to handle this cleanly, I'd love to hear how you guys are handling this without the if/else in view.
Beta Was this translation helpful? Give feedback.
All reactions