Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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