Skip to content

Instantly share code, notes, and snippets.

@mattsgarrison
Created May 9, 2012 15:35
Show Gist options
  • Save mattsgarrison/2645606 to your computer and use it in GitHub Desktop.
Save mattsgarrison/2645606 to your computer and use it in GitHub Desktop.
Adding Gists to RefineryCMS-Blog
<%-# This is the default way the file puts post content on the page. %>
<%= @post.body.html_safe %>
<%-# This is the replacement for that line. %>
<%= raw @post.body.html_safe.gsub(/\[gist:(\d+)(\,)(.+)\]/,"<script src='https://gist.github.com/\\1.js?file=\\3'></script>") %>
rake refinery:override view=refinery/blog/posts/_post.html.erb
[gist:2645606,override.sh]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment