last day (15 days later) » 

8:02 PM
0
Q: Angular Templates on Rails

jcuenodI'm using the angular-rails-templates gem. I have a folder in my /app/assets/javascripts called templates and I have included it in application.js: //= require_tree ./templates Inside of templates there is a test.html file with <h1>hello world</h1>. For some reason, test.html is not being fou...

 
I'd really recommend you to keep templates out of the asset pipeline. You could serve them with a standard controller
 
@apneadiving thanks but why? Also, if it's really recommended, what's the point of angular-rails-templates? (you don't need to serve them with a controller, can't you just put them in /public)
 
ok, so my point is you should not clutter your asset pipeline. Dont know this gem but if it puts stuff in /public, its fine
 
The gem seems to be what people recommend to use when you're trying to use angular templates with rails (which is all I'm trying to figure out)
 
from what I can see, it puts your templates in your assets, and I wouldnt recommend this :) but you know tastes and colors...
 
8:02 PM
just curious - why would you not recommend it?
 
because you add load to your js files where templates are just meant to be retrieved through usual queries
 
I'm not sure that I understand what you mean - do all the template files saved like this end up in a minified js file (and that's the problem)?
 
8:26 PM
yes
or at least this is what I understand when reading through the gem's doc
maybe I'm wrong
havent spent much time on it
 
8:43 PM
no, I think you're right but the templates are just going to end up another http request - why is that a better option?
 
consider a mobile consuming your app
I feel like its better to make initial load lighter
who would need all the templates right away?
 
9:12 PM
fair enough - that makes a lot of sense
can you rely on rails not to do anything to your /public folder though? I feel like it has enough magic that I just don't know...
 

last day (15 days later) »