2 ms·
Can you provide some details on why the partials have to be namespace'd to the sync directory? My guess is: sync partials can only be "resource" based, and can
by tomhallett 14y ago
Can you provide some details on why the partials have to be namespace'd to the sync directory? My guess is: sync partials can only be "resource" based, and can't be given locals like a regular partial. Therefore, sync-partials are a subset of regular partials, so a different directory makes the distinction very clear.
Just curious what the reason is.
Looks very cool, I will definitely try it out!
- chrismccord 14y agoYou're right about part of the reason. One reason the partials are namespaced is indeed to serve as a distinction since at the moment, only the resource can hold the context for the partial. ivars will be visible from both the parent view render and controller sync calls, but likely not reliable since the partials will be rendered from different actions. The main reason they are namespaced is to allow rendering of all partials for the sync'd resource when publishing syncs in the controller. We can just ask the resource to give us all its partials in the views/sync/[resource pluralized] directory and only render those partials that are realtime, versus needlessly rendering all partials (including non-realtime) in the 'normal' resource directory.