ruby on rails - Return Array in a helper method -
why can't homecoming array in helper method?
def childrenof(a) @children = post.find_by_parent_id(a.id) homecoming @children end thanks in advance
you can.
use find_all_by_parent_id instead.
and don't need sec line.
the next enough.
def childrenof(a) @children = post.find_all_by_parent_id(a.id) end ruby-on-rails arrays helpermethods
No comments:
Post a Comment