Problem with displaying content when using RJS
- by Shreyas Satish
I'm quite sure this is a silly error but I'm unable to spot it. Please help me out on this.
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', :partial => '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. Thanks !