开发者

Rails - Change locations of the default views, layouts, and partials paths

开发者 https://www.devze.com 2023-03-14 06:49 出处:网络
I want to change the location of my view files from app/views/* to view/html/*, my layouts directory from app/views/layouts/* to view/layouts/*, and, lastly, I would like to store my partials separate

I want to change the location of my view files from app/views/* to view/html/*, my layouts directory from app/views/layouts/* to view/layouts/*, and, lastly, I would like to store my partials separate开发者_开发百科 from my views in a location like view/partials/*. How would I do this?


First of all, I'd be very curious as to why you'd want to do this.

Rails does have view paths but these aren't really capable of this kind of customization.

You'd be better off using symlinks on a *nix like OS.

$ ln -s source_file link_name

For example:

$ ln -s app/views view/html
0

精彩评论

暂无评论...
验证码 换一张
取 消