我有工作正常使用HTML中的form_tag,但是當我使用AJAX與遠程=>真我收到此錯誤: - 我的終端日誌顯示: -錯誤:Ruby on Rails的3
Started GET "/" for 127.0.0.1 at 2010-11-01 01:19:49 +0000
Processing by HomepagesController#index as HTML
Homepage Load (0.6ms) SELECT "homepages".* FROM "homepages"
Rendered homepages/index.html.erb within layouts/application (23.0ms)
Completed 200 OK in 40ms (Views: 27.3ms | ActiveRecord: 0.6ms)
Error during failsafe response: incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string)
*那麼cleaner.rb東西 負載則: -
Started GET "/homepages?utf8=%E2%9C%93&search=hom" for 127.0.0.1 at 2010-11-01 01:19:56 +0000
Processing by HomepagesController#index as JS
Parameters: {"utf8"=>"✓", "search"=>"hom"}
Homepage Load (0.5ms) SELECT "homepages".* FROM "homepages" WHERE (section LIKE '%hom%')
Rendered homepages/index.js.erb (2.9ms)
Completed in 19ms
在我index.js.erb的,我有: -
$("testsearch").update("<%= escape_javascript(render(@homepages))%>");
,並在我的控制,我有: -
def index
@homepages = Homepage.search(params[:search])
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @homepages }
format.js { render :layout => false }
end
在我看來
我有: - 它打印使用使用<%@ homepages.each表@homepages做|設爲首頁| %>沒有被更新。
任何人有任何想法,爲什麼我得到這個錯誤。
縮進4個空格以突出顯示代碼 – s84 2010-11-01 02:21:54