Displaying 1 result from an estimated 1 matches for "inventory_control".
2007 Nov 16
4
Newb - variable returns # sign?
...ant to return the variety from the species table based on the
active record link to inventory table
class Species < ActiveRecord::Base
  has_many :inventories
end
class Inventory < ActiveRecord::Base
  belongs_to :species  (this is the singular and the plural, so that''s
OK)
end
My inventory_controller looks like:
 def show
    @inventory = Inventory.find(params[:id])
   @variety = Species.find(params[:species_id])
   end
and in the inventory show view:
<%= @variety %>
my out put shows all the fields from the inventory but only a pound
sign(#) where the @variety is at.
Any thoughts?...