Rails 3.1.3无法访问assets/javascripts文件夹内的文件 [英] Rails 3.1.3 unable to access the file inside assets/javascripts folder
问题描述
我已将fancybox(jquery插件)放在资产/javascripts/includes/jquery.fancybox-1.3.4内
I have put fancybox (jquery plugin ) inside the assets/javascripts/includes/jquery.fancybox-1.3.4
在此位置之前,我还尝试将其放在/vendor/assets/stylesheets/jquery目录下.
Before this location i also tried to put it under /vendor/assets/stylesheets/jquery directory.
我收到了这个奇怪的错误&为什么Rails无法将特定文件放在正确的位置.
I am getting this weird error & why isn't rails able to get the particular file when its right there.
-------------开发日志----------------
------------- Development Log ----------------
在2011-11-25 13:30:42为127.0.0.1启动GET"/vendor/assets/stylesheets/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack.js" -0800
Started GET "/vendor/assets/stylesheets/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack.js" for 127.0.0.1 at 2011-11-25 13:30:42 -0800
ActionController :: RoutingError(没有与[GET]匹配的路由"/vendor/assets/stylesheets/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack.js"):
ActionController::RoutingError (No route matches [GET] "/vendor/assets/stylesheets/jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack.js"):
在急救/布局内渲染/Users/jayparteek/.rvm/gems/ruby-1.9.2-head@default/gems/actionpack-3.1.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb( 0.5ms)
Rendered /Users/jayparteek/.rvm/gems/ruby-1.9.2-head@default/gems/actionpack-3.1.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.5ms)
--------------日志2 -------------------------
-------------- Log 2 -------------------------
ActionController :: RoutingError(没有与[GET]匹配的路由"/vendor/assets/javascripts/fancybox-1.3.4/jquery.fancybox-1.3.4.pack.js"):
ActionController::RoutingError (No route matches [GET] "/vendor/assets/javascripts/fancybox-1.3.4/jquery.fancybox-1.3.4.pack.js"):
推荐答案
只需使用精美的装饰盒 https: //github.com/hecticjeff/fancybox-rails
Simply use the fancy box gem https://github.com/hecticjeff/fancybox-rails
这篇关于Rails 3.1.3无法访问assets/javascripts文件夹内的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!