[英]Inline Javascript in Rails
I've been just adding my individual scripts at the bottom of my rails views via script tags. 我一直在通过脚本标签将自己的脚本添加到我的rails视图的底部。
It just seems way easier and more intuitive to include a one off script in the actual view rather than a separate JS file. 在实际视图中包括一个脚本而不是一个单独的JS文件似乎更加容易和直观。 But what are the arguments against doing this?
但是反对这样做的理由是什么?
Having the script in a separate file, you can: 将脚本保存在单独的文件中,您可以:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.