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? :D -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > 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? :D > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
James, Thank you for your feedback, the example gave me nice insight. Resolved :) Have a good week! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---