A typical rails controller might do something like this:
class FoosController < ApplicationController
def index
@foos = Foo.all
end
end
I understand rails well enough to know that @foos will return an array of Foo objects, but that @foos itself is an instance variable.
So which object does the instance variable belong to? Would it be an instance of the FoosController class? Is a different instance of this object created every time I access the index page? What about if I access the show page, where a new variable @foo is introduced:
def show
@foo = Foo.find(params[:id])
end
Does this variable belong to the same object that @foos belongs to?