Skip to content

Instantly share code, notes, and snippets.

@angelsystem
Created May 24, 2016 17:29
Show Gist options
  • Save angelsystem/3512932641cb4e6688b8a4b094be08fc to your computer and use it in GitHub Desktop.
Save angelsystem/3512932641cb4e6688b8a4b094be08fc to your computer and use it in GitHub Desktop.
def thumbnail
raise ActionController::RoutingError.new('Not Found') unless @file.thumbnail?
if stale?(@file, public: true, template: false)
send_file(@file.thumbnail_path, disposition: 'inline', type: 'image/png', filename: thumbnail_filename)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment