cells icon indicating copy to clipboard operation
cells copied to clipboard

Context when nesting cells?

Open ericgross opened this issue 9 years ago • 2 comments

We are calling a cell from the controller with a context, and that cell is rendering cells inside of itself passing a context. It appears that the context for the nested cells are the same as the original context specified in the controller and that the context that is added directly in the slim template is not available in the nested cell.

Shouldn't the context for nested cells be a superset of the cells' callers' context?

ericgross avatar Sep 12 '16 16:09 ericgross

Currently, the context is "global".

apotonick avatar Oct 22 '16 12:10 apotonick

+1 for this issue. Instantiated a cell from within another cell and passed in a context hash but the 'child' cell's context was overridden to the parent cell's context instead so the extra context was lost. Seemed a bit counterintuitive - I was expecting an overwrite (i.e. child cell would get the explicit context or a merger of the parent's context and the supplied context), but not for it to be silently ignored. Ended up using the options hash instead.

Xanthus avatar Feb 01 '17 20:02 Xanthus