Skip to content

Instantly share code, notes, and snippets.

@joho
Forked from mtcmorris/gist:1194204
Created September 5, 2011 06:24
Show Gist options
  • Save joho/1194221 to your computer and use it in GitHub Desktop.
Save joho/1194221 to your computer and use it in GitHub Desktop.
Mustaches for everyone!!
<% if moustaches? %>
<script type="text/javascript">
$(document).ready(function() {
$(".thumbnail img").each(function() {
$(this).attr("src", "http://mustachify.me/?src=" + $(this).attr("src"));
});
});
</script>
<% end %>
class ApplicationController < ActionController::Base
# inspired by https://gist.github.com/1194204
def moustaches?
!!params[:moustaches]
end
helper_method :moustaches?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment