ActionController :: RoutingError(没有路由与"/javascripts/rails.js"匹配) [英] ActionController::RoutingError (No route matches "/javascripts/rails.js")

查看:81
本文介绍了ActionController :: RoutingError(没有路由与"/javascripts/rails.js"匹配)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jquery gem,并已安装了所有可去除质子的东西.

I am using the jquery gem and have installed everything which removes proton.

我收到此错误,但我不明白为什么?

I am getting this error and I don't understand why?

ActionController::RoutingError (No route matches "/javascripts/rails.js")

我在日志中看到了.

任何想法.

谢谢.

推荐答案

我刚刚解决了一个类似的问题-更新了我的包(包括jquery-rails)并运行了rails generate jquery:install(更新jquery本身)之后.据我了解,rails.js现在已被jquery_ujs.js取代(不过我不确定这是明智之举).

I've just fixed a similar problem -- after updating my bundle (including jquery-rails) and running rails generate jquery:install (updating jquery itself). As far as I understand, rails.js is now replaced by jquery_ujs.js (I'm not sure it is a smart move though).

您应该继续删除应用程序中对rails.js的任何引用,其中两个可能的地方是:

You should go on and eliminate any references to rails.js in your app, two possible places to look in are:

config/application.rb-您可能可以完全删除config.action_view.javascript_expansions[:defaults] = %w(jquery rails)

config/application.rb — you can probably remove the config.action_view.javascript_expansions[:defaults] = %w(jquery rails) line completely

app/views/layouts/application.*-您应该在那里有!= javascript_include_tag :defaults行,并且 not jqueryrails的引用.

app/views/layouts/application.* — you should have a != javascript_include_tag :defaults line there and not references to jquery or rails.

这篇关于ActionController :: RoutingError(没有路由与"/javascripts/rails.js"匹配)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆