# Find(:all) that works when called by regular view but not rss builder

**URL:** <https://www.ruby-forum.com/t/find-all-that-works-when-called-by-regular-view-but-not-rss-builder/132109>\
**Category:** Rails\
**Created:** [March 17, 2008, 4:09am UTC](https://www.ruby-forum.com/t/find-all-that-works-when-called-by-regular-view-but-not-rss-builder/132109 "2008-03-17T04:09:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/82dd89/32.png) [@jeremy](https://www.ruby-forum.com/u/jeremy)\
**Post date:** [March 17, 2008, 4:09am UTC](https://www.ruby-forum.com/t/find-all-that-works-when-called-by-regular-view-but-not-rss-builder/132109/1 "2008-03-17T04:09:33Z")

</div>

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

1. def index
2. @newest\_ratings = Rating.find(:all, :order =\> “twitter\_num  
DESC”, :limit =\> 20)
3. 
4. 
# . . . some other code . . .
5. 
6. respond\_to do |format|
7. 

```
 format.html

```

8. 

```
 format.rss {render :layout => false}

```

9. end
10. 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:

```
ActiveRecord::StatementInvalid (Mysql::Error: Table

```

‘twitterate.ratings’ doesn’t exist: SELECT \* FROM `ratings` ORDER  
BY twitter\_num DESC LIMIT 20):

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.
