All threads / How do I add embedded youtube video to a text field within active admin with simplemde markdown?
Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I add embedded youtube video to a text field within active admin with simplemde markdown?

Bruce asked in Rails

When I add the Youtube embed code. It displays it as a string on the front end.
The idea is that I could make this simple enough for the user updating the post to add the embed code easily themselves.

I solved this by adding "raw" in the view and I can now paste embed code into active admin

<%=@post.content%>

is now

<%= raw(@post.content)%>

I need to add a youtube video to a text field in the active admin. Active Admin uses simplemde markdown, which supports embedded youtube videos and you can go at https://theleader.info/2022/05/17/how-to-choose-a-genius-essay-writing-service/ to write quality description for your videos. However, when I try to add the same embedded youtube video to an embedded text field, it does not work.

By including "raw" in the view, I was able to resolve this and now I can paste embed code into active admin.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 66,029+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.