我試圖做一個簡單的測試與facebox_render和軌道3軌道/ facebox_render - 阿賈克斯沒有定義(facebox總是加載...)
這裏是我的步驟:
1)安裝的Jquery 1.4.2(Jrails)
2.)插件安裝 軌道插件安裝GIT中://github.com/ihower/facebox_render.git
3。),並添加下列行:
在我application.html.erb
<head>
<title><%= yield(:title) || "Untitled" %></title>
<%= stylesheet_link_tag "reset", "application", "facebox" %>
<%= javascript_include_tag :defaults, "facebox" %>
<%= csrf_meta_tag %>
<%= yield(:head) %>
</head>
,並在我的application_controller
class ApplicationController < ActionController::Base
include FaceboxRender
end
當我試圖在facebox加載的東西,只有裝載機,會出現什麼我有...
例如,在我家/ index.html.erb
<%= facebox_link_to "test", :url => "/images/rails.png" %>
我會很高興知道我錯了,在DOC:
* facebox_link_to helper, it’s will launch loading facebox first, send ajax request second)
* link_to :remote => true, form_for :remote => true …etc Ajax helper (for Rails 3)
所以我覺得我卡發送Ajax請求..
看下面的文章後:How to make facebox popup remain open and the content inside the facebox changes after the submit看來,我有同樣的問題:我可以看到螢火蟲YHE控制檯
我的js文件不過是正確加載「阿賈克斯沒有定義」:(作爲源代碼顯示)
<link href="/stylesheets/reset.css" media="screen" rel="stylesheet" type="text/css">
<link href="/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css">
<link href="/stylesheets/facebox.css" media="screen" rel="stylesheet" type="text/css">
<script src="/javascripts/jquery.min.js" type="text/javascript"></script>
<script src="/javascripts/rails.js" type="text/javascript"></script>
<script src="/javascripts/facebox.js" type="text/javascript"></script>
<script src="/javascripts/application.js" type="text/javascript"></script>
謝謝任何幫助!