Skip to content

Instantly share code, notes, and snippets.

@yvesvanbroekhoven
Created June 2, 2010 11:23
Show Gist options
  • Save yvesvanbroekhoven/422228 to your computer and use it in GitHub Desktop.
Save yvesvanbroekhoven/422228 to your computer and use it in GitHub Desktop.
Ruby function for getting the file extension
File.extname(File.basename(file_url)).gsub(/\./, '').gsub(/\?[0-9]*/, '')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment