开发者

Problem with displaying content when using RJS

I'm quite sure this is a silly error but I'm unable to spot it. Please help me out on this.

I'm using a select tag to select a topic, which triggers the filter_by_content method. I'm using Rails 2.3.2.

This is my controller code

def filter_by_content
  @articles = Article.find(:all)
end

My RJS (filter_by_content.rjs)

update_page do |page|
  page.replace_html 'articles', :partia开发者_开发技巧l => 'main/filtered', :object => @articles
end

My Partial 'filtered'

<div id = "articles">
  <% if @articles %>
    <% @articles.each do |article| %>
      <%= article.title %>
    <% end %>
  <% end %>
</div>

I checked my server, and the articles are sure getting fetched but the problem is with displaying them.


Ok turns out, if I remove the reference to JQuery and use only prototype, it works fine.

So I had to install JRails and now it works fine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜