Skip to content

Instantly share code, notes, and snippets.

@joho
Forked from mtcmorris/gist:1194204
Created September 5, 2011 06:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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