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
for resources to be self-contained, they need a way to present themselves to the user, ie. on a web page. an obvious solution is of course the view resource. what is the most conventional way to incorporate views into a resource?
i was thinking
// in .start(), a conventional resource method for initializing a resource
var view = resource.use('view');
view.create({ path: __dirname + '/view' }, function(err, _view) {
<resource>.view = _view;
}
If a /view/ folder exists in a resource, it should be considered the default view for that resource. A few apps and resources exist with this convention already.
The best way to specify a view is to explicitly set the view in the resource itself, then set resource.view to the generated view.
The sync api for view.create was removed, so putting view.create in a resource.start method is good. You could also try using a resource.before hook on start to keep the code more compact.
for resources to be self-contained, they need a way to present themselves to the user, ie. on a web page. an obvious solution is of course the view resource. what is the most conventional way to incorporate views into a resource?
i was thinking
that way when you want to view the resource,
or
The text was updated successfully, but these errors were encountered: