When you do <%= foo %>, it just tries to turn foo into a string.
For your basic activerecord model, that gives you something like #<Question:0x17ce158>, so I'm not surprised that the browser only displays a #. Depending on what you're trying to do you may want to define to_s on your model, show each property individually or if you're just checking that @variety is being set properly you can use <%= debug @variety %>
Keeping in mind that each inventory item has only species; if I
wanted to display the variety (from species) while I was in the show
view (of inventory) do I even need to set a variable? In SQL (my
background) I would : "SELECT variety FROM species a, inventory b
WHERE a.id = b.species_id AND b.id = (the current record)" I just
want to display the associated value from another table, Sorry for the
simplistic questions, I have searched my book and this forum to no
avail.
Keeping in mind that each inventory item has only species; if I
wanted to display the variety (from species) while I was in the show
view (of inventory) do I even need to set a variable? In SQL (my
background) I would : "SELECT variety FROM species a, inventory b
WHERE a.id = b.species_id AND b.id = (the current record)" I just
want to display the associated value from another table, Sorry for the
simplistic questions, I have searched my book and this forum to no
avail.
The only problem you're having is that the output from <%= @variety %>
is not html friendly. if you were to look at the raw page source you'd
see something like #<Variety: #0x123465>.
Replace it with something else (see my previous email for
suggestions). and you should be fine