Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subdirectories #1

Open
Dovernh opened this issue Apr 4, 2014 · 6 comments
Open

subdirectories #1

Dovernh opened this issue Apr 4, 2014 · 6 comments

Comments

@Dovernh
Copy link

Dovernh commented Apr 4, 2014

Took the code vash-express-example as a starting point. Made the directory structure like this
image

changed the code for 1 directory to look like this
image

get error:
image

I know I can change the code globally: app.set('views', path.join( __dirname, '/views') );
But I want to easily to point to views in the views/customers and views/orders

@kirbysayshi
Copy link
Owner

In your above example, you still need to set

app.set('views', path.join( __dirname, '/views') );

even if you want to use 'customers/index'. Otherwise, express is looking
for [project root]/customers/index.vash instead of [project root]/views/customers/index.vash

Yip yip,
~ Drew*

On Fri, Apr 4, 2014 at 12:24 PM, Dovernh [email protected] wrote:

Took the code vash-express-example as a starting point. Made the directory
structure like this
[image: image]https://cloud.githubusercontent.com/assets/1800249/2617607/ee4a1484-bc14-11e3-8a12-305e5e4200ea.png

changed the code for 1 directory to look like this
[image: image]https://cloud.githubusercontent.com/assets/1800249/2617624/2716ddf6-bc15-11e3-8f0d-5fcc1e41de7e.png

get error:
[image: image]https://cloud.githubusercontent.com/assets/1800249/2617628/3ebb93c0-bc15-11e3-9098-a4e7d424f06a.png

I know I can change the code globally: app.set('views', path.join(
__dirname, '/views') );
But I want to easily to point to views in the views/customers and
views/orders

Reply to this email directly or view it on GitHubhttps://github.com//issues/1
.

@kirbysayshi
Copy link
Owner

Whoa that got mangled by gmail. Original message:

In your above example, you still need to set app.set('views', path.join( __dirname, '/views') ); even if you want to use 'customers/index'. Otherwise, express is looking for [project root]/customers/index.vash instead of [project root]/views/customers/index.vash

Is this what you're looking for, or are you trying to do something different?

@Dovernh
Copy link
Author

Dovernh commented Apr 5, 2014

Drew,

Still not working for me. I have:

app.set('views', path.join( __dirname, '/views') ); // critical to use path.join on windows

exports.index = function(req, res){
res.render('customers/index', {
title: 'Express'
,reasons: [
"Razor Syntax"
,"Still HTML"
,"You can macro your macros into your macros, if you want to"
]
});
};

I trying this on my mac

On Apr 4, 2014, at 4:00 PM, Andrew Petersen [email protected] wrote:

In your above example, you still need to set

app.set('views', path.join( __dirname, '/views') );

even if you want to use 'customers/index'. Otherwise, express is looking
for [project root]/customers/index.vash instead of [project root]/views/customers/index.vash

Yip yip,
~ Drew*

On Fri, Apr 4, 2014 at 12:24 PM, Dovernh [email protected] wrote:

Took the code vash-express-example as a starting point. Made the directory
structure like this
[image: image]https://cloud.githubusercontent.com/assets/1800249/2617607/ee4a1484-bc14-11e3-8a12-305e5e4200ea.png

changed the code for 1 directory to look like this
[image: image]https://cloud.githubusercontent.com/assets/1800249/2617624/2716ddf6-bc15-11e3-8f0d-5fcc1e41de7e.png

get error:
[image: image]https://cloud.githubusercontent.com/assets/1800249/2617628/3ebb93c0-bc15-11e3-9098-a4e7d424f06a.png

I know I can change the code globally: app.set('views', path.join(
__dirname, '/views') );
But I want to easily to point to views in the views/customers and
views/orders

Reply to this email directly or view it on GitHubhttps://github.com//issues/1
.


Reply to this email directly or view it on GitHub.

@kirbysayshi
Copy link
Owner

It would really help if you committed the code and pushed it to your fork, then I could try it out.

@Dovernh
Copy link
Author

Dovernh commented Apr 5, 2014

It’s up there on github. I am hoping you can access it. Here’s the url: https://github.com/Dovernh/vash-express-example.git

On Apr 4, 2014, at 8:41 PM, Andrew Petersen [email protected] wrote:

It would really help if you committed the code and pushed it to your fork, then I could try it out.


Reply to this email directly or view it on GitHub.

@kirbysayshi
Copy link
Owner

Definitely a bug in vash! I'm working on a fix. In the meantime, you can
specify paths relative to the views directory as a workaround.

For example, in
https://github.com/Dovernh/vash-express-example/blob/75392713c17e6fd6e76ae86afe8f86deb96e51f8/views/customer/index.vash#L7,
if you use './customers/hours', it will work.

Again, it's definitely a bug, but that's a temporary workaround.

Yip yip,
~ Drew*

On Fri, Apr 4, 2014 at 10:12 PM, Dovernh [email protected] wrote:

It's up there on github. I am hoping you can access it. Here's the url:
https://github.com/Dovernh/vash-express-example.git

On Apr 4, 2014, at 8:41 PM, Andrew Petersen [email protected]
wrote:

It would really help if you committed the code and pushed it to your
fork, then I could try it out.

Reply to this email directly or view it on GitHub.

Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-39626449
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants