Skip to content

Instantly share code, notes, and snippets.

@evie404
Last active December 14, 2015 02:59
Show Gist options
  • Save evie404/5017676 to your computer and use it in GitHub Desktop.
Save evie404/5017676 to your computer and use it in GitHub Desktop.
class Photo < ActiveRecord::Base
#...
def image_url *args
url = super
url.gsub!('.', '@2x.') if args[0] == :square_thumb #add @2x to filename if square_thumb is requested
url
end
#...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment