Putting Javascript at the end of the file using Rails 3.1 asset pipeline

旧时模样 提交于 2019-12-06 15:39:14

Yes, you can do this with Rails 3.1 — it doesn't make any difference (as far as Rails is concerned) where you put your javascript_include_tag lines in your view/layout.

Not sure if you got the answer for this, but you can include multiple manifest files and set up which files you want at the bottom of the page.

In other words, I could create a footer.js manifest file, tell it to include the scripts you want, and then at the bottom of your view template, include it the same way you do your application.js file with the

<%= javascript_include_tag("footer") %>

tag.

You can read more here-

http://coderberry.me/blog/2012/04/24/asset-pipeline-for-dummies/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!