i am a newbie to the ROR world, hope you can give me a hand to start rolling on my ROR project. here is what i am getting stuck. i have 2 entities in the database (2 tables - fruit and vegetable). i want to create a page to show the both entities, naming "food_listing". should i just create a model and a controller for the "food_listing" page, if so, what should be specified in the model and controller page? (i beleive i would hv the ability to create a View page for that, just not sure abt the controller and model page) many thanks for you input in advanced. r8r --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You don''t have to create a new model, just a new controller. Sounds like you have two tables: fruits vegetables Build a controller using ./script/generate controller FoodListing and then in the app/controllers/food_listing.rb add def index @fruits=Fruits.find(:all) @veggies=Vegetables.find(:all) end then in your app/views/food_listing create a file called index.rhtml, and put something in like <%= @fruits %> <%= @veggies%> Not quite sure if that last part would work exactly, but you can use the vars at that point to do what you want. --~--~---------~--~----~------------~-------~--~----~ 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 Joe! Thanks for your reply, that''s extremely helpful. I will give it a try now, many thanks! :) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---