Reputation: 10541
I'm using angular.js as my clientside framework and rails as my serverside framework. One slight stumbling block is where should I store my angular view templates?
Let's say I'm making a custom directive:
directive("foobaz", function (cart) { return {
restrict: "E",
templateUrl: "components/bing/foobaz.html"
}
How should I serve up components/bing/foobaz.html
? Should I put it in my public folder:
root/public/bing/foobaz.html
Or should I make routes and a controller to serve up angular views?
Upvotes: 0
Views: 173
Reputation: 446
We have angular-rails application. And we store templates in app/assets/templates dir, and use haml for templates. For those purposes we're using angular-rails-templates gem
Upvotes: 0
Reputation: 101
Make a folder app/assets/templates/.
It will hold all of your angular templates. please refer this link to get more details http://start.jcolemorrison.com/setting-up-an-angularjs-and-rails-4-1-project/
Upvotes: 3
Reputation: 144
you can use layouts folder in
app -> views -> layouts
or with .yml, we can store it in config and no need to mention in routes.
Upvotes: 1