Hey guys, I’m new to your ruby forums. Cool place
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?
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 Have a good week!