Jason R. Kretzer


2,220 Experience
22 Lessons Completed
0 Questions Solved


Posted in Rich Text Blog Posts with ActionText Discussion

Chris does not cover this in the video but I thought it was neat. If you want to see your video attachments actually play and not just have an image preview, you just need to modify a couple of files.

# change this
<% if blob.representable? %>
# to
<% if blob.video? %>
  <video controls="true" width="100%" preload="metadata">
    <source src="<%= rails_blob_url(blob) %>" type="<%= blob.content_type %>"></source>
<% elsif blob.representable? %>


# add this to inside the class
config.after_initialize do
  ActionText::ContentHelper.allowed_attributes.add "style"
  ActionText::ContentHelper.allowed_attributes.add "controls"

  ActionText::ContentHelper.allowed_tags.add "video"
  ActionText::ContentHelper.allowed_tags.add "audio"
  ActionText::ContentHelper.allowed_tags.add "source"

Posted in Adding Scheduled Blog Posts Discussion

Use the bin/dev command to start your server as noted in video 12 (Adding TailwindCSS to Rails). Otherwise the site does not get all the tailwindcss built in.