Ruby for Rails: underfined method 'name ' for #<Array:0xb6c971cc>
- by erwin
Hi, I want to display the column 'name' after being found from the table mytest.
In the mytest.rb, I defined "attrib_accessor :name";
In the procedure index under directory /controller/mytest_controller.rb,
def index
.....###[Ignore some code]
@[email protected]_by_id
### I am able to verify the tuples in @mytesttbl
end
In the /view/mytest/index.rhtml, I have code like
"mytesttbl", :object = @mytesttbl)%
In the /view/mytest/_mytesttbl.html.erb. I have code like
<%=mytesttbl.name %
when I ran the above code, I have error on _mytesttbl.html.erb,
underfined method 'name ' for #
Please help. Thanks,