Optimal order of csrf_meta_tag?
In Rails, my understanding is that we try to put stylesheets before javascript, and javascript near the end of the document to allow the DOM to fire faster.
Here's another question - where do tags g开发者_StackOverflow社区o for optimum performance? My question is most specific to Rails' csrf_meta_tag
. At the moment, I have a random assortment of orders - sometimes this tag is above CSS/JS, sometimes in the middle, sometimes below both. Any insight on this would be much appreciated.
Just try to keep your code clean an DRY. It is for you where to put your CSSs, Javascript and Meta tag. But usually I do next way:
<%= stylesheet_link_tag ... %>
<%= javascript_include_tag ... %>
<%= csrf_meta_tag %>
精彩评论