As I'm diving into RoR, I'm learning about some of the view asset tags and trying to undertand the benefit of using them instead of just using straight html. For example, what's the benefit, aside from brevity, of using <%= stylesheet_link_tag "main" %>
instead of just writing out the actual HTML? Then I came across the cache
option that allows the server to send multiple stylesheets in one download and that seems like a huge benefit. My questions are...
- Are there any downsides to using the
cache
option? Without knowing much about RoR, it would seem to me like you would definitely and always want to do this simply to reduce the number of requests your browser needs to make. True? - If you're not using the
cache
option, what's the benefit (aside from brevity) of using the stylesheet_link_tag or javascript_link_tag instead of just writing the HTML it generates?
Thanks so much in advance for your wisdom!