# Crucial LOC missing in ruby preview example

**URL:** <https://community.prismic.io/t/crucial-loc-missing-in-ruby-preview-example/6758>\
**Category:** Developing with Prismic\
**Tags:** ruby\
**Created:** [August 26, 2021, 12:25pm UTC](https://community.prismic.io/t/crucial-loc-missing-in-ruby-preview-example/6758 "2021-08-26T12:25:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![david5](https://avatars.discourse-cdn.com/v4/letter/d/839c29/32.png) [@david5](https://community.prismic.io/u/david5)\
**Post date:** [August 26, 2021, 12:25pm UTC](https://community.prismic.io/t/crucial-loc-missing-in-ruby-preview-example/6758/1 "2021-08-26T12:25:17Z")

</div>

Hi!  
The documentation for the preview functionality for Ruby is missing crucial line of code.  
In your Rails starter there's an additional LOC setting the preview cookie value to the preview token created when clicking "Preview" in prismic.  
In the documentation this line is missing.

It took me quite some time to figure out why my previews were not working, since I had copied your supplied code but still couldn't get it running.

Page of documentation: [Prismic’s documentation for PHP, Laravel, Java, .NET, and Ruby has moved to GitHub - Prismic](https://prismic.io/docs/technologies/previews-and-the-prismic-toolbar-ruby)

Missing LOC

```auto
cookies[Prismic::PREVIEW_COOKIE] = { value: preview_token, expires: 30.minutes.from_now }

```

I think it would be good if the documentation was updated to match the starter repo.  
Thanks!

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [August 27, 2021, 1:23pm UTC](https://community.prismic.io/t/crucial-loc-missing-in-ruby-preview-example/6758/3 "2021-08-27T13:23:44Z")

</div>

Hi David,

Welcome to the Prismic community,

Before troubleshooting this issue, I would like to be sure it is not related to the preview issue that we have just deployed a fix to it today.  
[https://community.prismic.io/t/toolbar-preview-cookie-issue/6608/39](https://community.prismic.io/t/toolbar-preview-cookie-issue/6608/39)

For that, can you please re-check if it is working now **without the change that you have proposed**? And would be great if you can share your repository name (in a private message if necessary).

Best,  
Fares

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [August 30, 2021, 2:23pm UTC](https://community.prismic.io/t/crucial-loc-missing-in-ruby-preview-example/6758/10 "2021-08-30T14:23:24Z")

</div>

Also I've added that line to the documentation and the change is pending for review, thanks for reporting that.

---

<div class="post-metadata">

**Author:** ![david5](https://avatars.discourse-cdn.com/v4/letter/d/839c29/32.png) [@david5](https://community.prismic.io/u/david5)\
**Post date:** [August 30, 2021, 2:35pm UTC](https://community.prismic.io/t/crucial-loc-missing-in-ruby-preview-example/6758/11 "2021-08-30T14:35:32Z")

</div>

Hi @Fares!  
Unfortunately I haven't had the time to test without the explicitly setting the cookie.  
Let me know in case you figure out if it's needed or not, otherwise I'll hopefully be able to test within the coming week.

---

<div class="post-metadata">

**Author:** ![Fares](https://avatars.discourse-cdn.com/v4/letter/f/71e660/32.png) [@Fares](https://community.prismic.io/u/Fares)\
**Post date:** [August 30, 2021, 3:18pm UTC](https://community.prismic.io/t/crucial-loc-missing-in-ruby-preview-example/6758/12 "2021-08-30T15:18:30Z")

</div>

Thanks, @david5 for your response, In fact, I might not have the time to install the Ruby kit, and I don't have much experience in Ruby to run the sample project.

It would be really appreciated if you can have some time to test that in the coming weeks.

Cheers,  
Fares

---

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [November 23, 2021, 2:23pm UTC](https://community.prismic.io/t/crucial-loc-missing-in-ruby-preview-example/6758/25 "2021-11-23T14:23:26Z")

</div>

closed on November 23, 2021, 2:23pm UTC, flag & select 'Something Else' to reopen.

Threads close after a period of inactivity. [Flag this thread](https://community.prismic.io/t/re-open-a-thread/2175) to re-open it and continue the conversation.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 3:28pm UTC](https://community.prismic.io/t/crucial-loc-missing-in-ruby-preview-example/6758/26 "2021-12-09T15:28:03Z")

</div>

Opened on December 9, 2021, 3:28pm UTC


