# Find(:all) problem when using rss builder

**URL:** <https://www.ruby-forum.com/t/find-all-problem-when-using-rss-builder/132152>\
**Category:** Rails\
**Created:** [March 17, 2008, 1:36pm UTC](https://www.ruby-forum.com/t/find-all-problem-when-using-rss-builder/132152 "2008-03-17T13:36:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jraines](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/34f0e0/32.png) [@jraines](https://www.ruby-forum.com/u/jraines)\
**Post date:** [March 17, 2008, 1:36pm UTC](https://www.ruby-forum.com/t/find-all-problem-when-using-rss-builder/132152/1 "2008-03-17T13:36:42Z")

</div>

I have an index page that displays the newest contents of a table  
called ratings. The controller code looks like this:

```auto

    def index
      @newratings = Rating.find(:all, :order => "twitter_num DESC",
:limit => 20)

     # . . . some other code . . .

     respond_to do |format|
       format.html
       format.rss {render :layout => false}
    end
  end
```

This works when I load index.html.erb, but when I try to load  
index.rss.builder, it just downloads an error page instead of an rss  
feed. When I check the log, this is the error:

```
[quote] ActiveRecord::StatementInvalid (Mysql::Error: Table
'twitterate.ratings' doesn't exist: SELECT * FROM `ratings` ORDER
BY twitter_num DESC LIMIT 20): [/quote]

```

This doesn’t make sense to me; how can it not realize that the table  
exists when it queries from it just fine when the same controller code  
is called from the other view template? To make it even weirder, I  
have a nearly identical setup with the ‘show’ method (does the same  
thing but for a single user) and it works fine when generating the rss.
