I'm sure I saw a while back a rails helper method where .each in the view accepts a separator such as a comma.
So say I want:
- @results.each do |result|
= result.title
#to output
result 1, result 2, result 3
TIA
I'm sure I saw a while back a rails helper method where .each in the view accepts a separator such as a comma.
So say I want:
- @results.each do |result|
= result.title
#to output
result 1, result 2, result 3
TIA
Not sure what you are refering to, but:
@results.collect { |r| r.title }.join( ',' )
should do what you want.