没有加载生产中的Ratyrate明星(heroku) [英] Ratyrate stars not loading in production (heroku)
问题描述
因此,我通过添加
<%= javascript_include_tag'ratyrate.js', data-turbolinks-track=>假%>
到我的视图的正文。在此之前,星星只会在直接访问网址或刷新网页时加载。
现在当我在Heroku上部署我的应用程序时,我遇到了完全相同的问题(当通过链接访问页面时,未加载星星)
我希望这是足够的信息(乐意提供更多信息),并且有人遇到过这种情况/有任何想法!谢谢!
解答 - 见答案 所以问题是我忘记运行 解决方案 还要添加 然后确保你运行 希望这有助于某人:) So ive got ratyrate working in development just fine by adding to the body of my view. Prior to this the stars would only load when the url was directly accessed or the page refreshed. Now I am having the exact same issue (stars not loading when page is accessed through a link) when deploying my app on heroku! I hope that this is enough info (happy to provide more) and that someone has faced this before/has any ideas! Thanks! solved - see answer So the problem was that I forgot to run SOLUTION Add Also add Then make sure you run Hope this helps someone :) 这篇关于没有加载生产中的Ratyrate明星(heroku)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! rake assets:precompile
。这个问题中提到的开发解决方案应该是可行的。
<%= javascript_include_tag'ratyrate.js',data-turbolinks-track=>假的%>
头部(似乎运行得更快)或身体标记在你的看法。
Rails.application.config.assets.precompile + =%w(ratyrate.js)
改为 config / initializers / assets.rb 。
rake assets:precompile
,以免看起来像我一样愚蠢!
<%= javascript_include_tag 'ratyrate.js', "data-turbolinks-track" => false %>
rake assets:precompile
. The solution for development mentioned in the question should work.<%= javascript_include_tag 'ratyrate.js', "data-turbolinks-track" => false %>
to the head (seems to run faster) or body tag in your view. Rails.application.config.assets.precompile += %w( ratyrate.js )
to config/initializers/assets.rb. rake assets:precompile
to avoid looking as silly as me!