Ruby for Rails: underfined method 'name ' for #<Array:0xb6c971cc>

Posted by erwin on Stack Overflow See other posts from Stack Overflow or by erwin
Published on 2010-03-18T18:19:20Z Indexed on 2010/03/18 18:21 UTC
Read the original article Hit count: 515

Filed under:
|

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,

© Stack Overflow or respective owner

Related posts about ruby

Related posts about rails