How to render a Key Text


I use Prismic with Ruby and I dont know how to render a Key Text field?

Thanks in advance,

Hi Abdellatif,

Rendering the key text field should be quite straight forward. It should be like so:

<%= @document[“blog-post.title”].as_text %>

You can also see how to do so from this article.

I use html.slim when I intergeted this code it show me directly the same ligne of code on my page in the navigator!

What result are you getting?

<%= @document[“”].as_text %>

I had a look at your api response and it seems you are returning a rich text field in the api response.

Can you show me the full code for the partial?

actually, I chang it just know to test another thing!