-
-
Save joho/1194221 to your computer and use it in GitHub Desktop.
Mustaches for everyone!!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% 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 %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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