2010-09-17 50 views
2

軌3.0Rails的AJAX UJS問題

<% link_to about_path, :remote => true do %> 
     About Us<span>Who we are</span> 
    <% end %> 


    def about 
    render :update do |page| 
     page[:content].replace_html :partial => 'dashboard/about' 
    end 
    end 

具有軌3.0 AJAX問題,只是想獲得它取代HTML與部分一個點擊。任何幫助是極大的讚賞。我正在嘗試使用在rails 3.0中實現的new:remote => true。

感謝

UPDATE: 下面是標記我得到。另外,當我點擊它時,我會進入一個新的屏幕,一大堆文字和白色背景。再次感謝。

<a href="/about" data-remote="true">    About Us<span>Who we are</span> 
</a> 

即使在嘗試ajax的基本示例。

你好
<%= link_to 'something, something_path, :remote=true %> 

控制器:

def something 
render :update do |page| 
page[test].visual_effect :blind_up 
end 
+0

看到日誌中的錯誤?在螢火蟲? – rfunduk 2010-09-17 16:00:45

+0

實際得到的是什麼標記? – rfunduk 2010-09-17 16:46:22

+0

已更新。謝謝。 – RoR 2010-09-17 17:17:38

回答