I am quite new in Ruby-on-rails. And I have a very simple question: This one works in my view file:
- @posts.each do |child|
= child.name
end
However, I can't create a helper method which takes an array as argument and iterate it with 'each'.
In my view file:
=f1(@posts)
In my helper file:
def f1(abc)
abc.each do |child|
puts child.name
end
end
Please help me out with this silly problem. Thanks a lot in advance