Identifying specific mysql tables

Hey guys, I’m new to your ruby forums. Cool place :slight_smile:

I was wondering if anyone knew how to only display specific tables in
‘list.rhtml’

for example, I have 10 tables. I only want to show one/two of them in
‘list.rhtml’

Anyone spare me hours of googling? :smiley:

Hi Kevin,
Are you looking to show the data from those tables on that page (say the
tables are called cats and dogs)? The basic rails idiom for this is:

controller:
def list
@cats = Cat.find(:all)
@dogs = Dog.find(:all)
end

view:
<% @cats.each do |cat| %>
some display code here
<% end %>

and repeat for @dogs.

Cheers,
James

On Mon, Feb 25, 2008 at 12:09 PM, Kevin Morris <

James,

Thank you for your feedback, the example gave me nice insight.

Resolved :slight_smile: Have a good week!