I am a real newbie at rails please help me. I have a controller called groceries and a model also called groceries. I generated both the model and controller with the /script.
I thought inside the controller i could call the model but it doesn't seem to work.
[ class GroceriesController < ApplicationController
def index @groceries = groceries.find(:all) respond_to do |format| format.html # index.html.erb format.xml { render :xml => @groceries } end end
]
groceries.find(:all) gives undefined variable or method
Do i need to make a scaffold ? is there something more i need to do to associate the model with the controller?