I'm trying to iterate through an array @idea_benefit which looks like this:
["happier_customers", "happier_employees", "increased_revenue", "happier_customers", "decreased_costs", "happier_customers", "increased_revenue", ]
I need its elements to be humanized and capitalized like:
["Happier Customers", "Increased Revenue", ...]
I tried this:
@idea_benefit = []
@evaluations.each do |eval|
@idea_benefit << eval.benefit
@idea_benefit.flatten
end
@idea_benefit.each do |benefit|
benefit.gsub("_", " ").capitalize
end
but I could not target the individual strings. How do I make this work?
but I've been unsuccessful targeting the individual stringscould you please elaborate that part with an example?