The following statement…
content_tag(:li, concept.title)
…returns something like:
<li>"My big idea"</li>
The following method definition, when called, returns the same:
def list_of_concepts(part)
content_tag(:li, concept.title)
end
As does…
def list_of_concepts(part)
content_tag(:li, part.concepts.first.title)
end
But the following…
def list_of_concepts(part)
for concept in part.concepts
content_tag(:li, concept.title)
end
end
…just gives me a bunch of pound signs (“#“) in my view, like it’s returning true or false or a count rather than whatever content_tag returns. How can I make it return what content_tag returns?
Thanks again,
Steven.
the for loop doesn’t return your data, try this: