create a page but not specified in the database

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.


You don't have to create a new model, just a new controller.

Sounds like you have two tables:

Build a controller using
./script/generate controller FoodListing

and then in the app/controllers/food_listing.rb add

def index

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.

Hi Joe! Thanks for your reply, that's extremely helpful. I will give
it a try now, many thanks! :slight_smile: