Skip to content

Instantly share code, notes, and snippets.

@huacnlee
Created July 17, 2012 06:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huacnlee/3127676 to your computer and use it in GitHub Desktop.
Save huacnlee/3127676 to your computer and use it in GitHub Desktop.
render SSI
# Render SSI
def render_ssi(path)
if Rails.env.development?
elid = "ssi_#{Digest::MD5.hexdigest(path)}"
raw %(
<div id="#{elid}"></div>
<script type="text/javascript">
$.get("#{path}", function(re){
$("##{elid}").html(re);
})
</script>
)
else
raw %(<!--# include virtual="#{path}" -->)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment