dimanche 25 octobre 2020

How do I print out model data without printing the array?

I know that this is basic, but I cannot figure it out for whatever reason.

I'm trying to return some model data and the majority of the time I return it with pluck, but pluck is returning an array. How do I return the value without the array?

<dd><%= Goal.where(id:post.attachid).pluck(:title) %></dd>

This is the code that I have and it is returning, for example, ["Computer"]

How do I just make it return Computer

Aucun commentaire:

Enregistrer un commentaire