Skip to content
Myr

Fixed up index view path alternative

Before adoption: this commit came in with the history the project adopted, so no landing records it.

previously was doing ../index, which was not intended now doing ../VIEW/index

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent a254e64 · Browse files · 2 files+5 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+5 added−3 removed

  • other:+5 added−3 removed

2 files+5 added−3 removed

modified:lib/view/view.js+3 added-2 removed
45 unmodified lines
46 this.parent = options.parentView;47 this.basename = basename(view);48 this.engine = this.resolveEngine();49 this.extension = '.' + this.engine;50 this.name = this.basename.replace(this.extension, '');51 this.path = this.resolvePath();52 this.dirname = dirname(this.path);53};54
105 unmodified lines
160 + '/index' + this.extension;161});162163/**163 * Return ../index path alternative.164 * Return ../<name>/index path alternative.165 *166 * @return {String}167 * @api public168 */169170View.prototype.__defineGetter__('upIndexPath', function(){170 return this.dirname + '/index' + this.extension;171 return this.dirname + '/../' + this.name + '/index' + this.extension;172});173174/**175 * Return _ prefix path alternative
36 unmodified lines
modified:lib/view.js+2 added-1 removed
270 unmodified lines
271 272 // Try index ex: ./views/user/index.jade273 if (!view.exists) view = new View(orig.indexPath, options);274275 // Try ../name ../user from within ./user275 // Try ../<name>/index ex: ../user/index.jade276 // when calling partial('user') within the same dir277 if (!view.exists && !options.isLayout) view = new View(orig.upIndexPath, options);278279 // Try layout relative to the "views" dir 280 if (!view.exists && options.isLayout) view = new View(orig.rootPath, options);
92 unmodified lines