Hi,
I have a function where I want to show the corresponding value in a select form based on the function below :
def index
@initval = Haus.find_all_by_haus_id(1)
end
It will return a list of value that has haus_id = "1" (so e.g. I will get a, b, c)
in index.rhtml, I want to show the list corresponding to haus_id="1", but showing only their timebuild (so e.g, I will get time of "a" was built, "b" was built, and "c" was built).
<select id="subtable" name="subtable" size="7" style="width: 150px">
<option selected value="<%= @initval.id %>"><%= @initval.timebuild%></option>
</select>
However, it returns
undefined method `timebuild' for #<Array:0x4b5c238>
If in select form I change @initval.timebuild to @initival.id , it will return a number (that I am not sure where it came from). How can I show a list of timebuild from haus that has haus_id="1" in the select form?
Please kindly guide.