开发者

Rails view templates in subdirectories

Is it possible to make rails automatically look in certain sub-directories for a view-template?

I have different formats on my page (html, iphone, android, js and so on..) and the views directories are starting to be a 开发者_StackOverflow中文版real mess. I would like rails to automatically look for templates in /html /iphone and so on and fall back to the normal directory if it can't find it. So for example, if the format is iphone, it will first look in /views/users/iphone/index.iphone.haml and if it can't find it, it will look for /views/users/index.iphone.haml.


http://www.axehomeyg.com/2009/06/10/view-path-manipulation-for-rails-with-aop/

Yes you can.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜