Skip to content

Instantly share code, notes, and snippets.

@IceskYsl
Created September 3, 2008 08:03
Show Gist options
  • Save IceskYsl/8558 to your computer and use it in GitHub Desktop.
Save IceskYsl/8558 to your computer and use it in GitHub Desktop.
desc 'Lists ActionController::StatusCodes::STATUS_CODES like routes'
task :status_codes => :environment do
puts "Status - Name"
ActionController::StatusCodes::STATUS_CODES.to_a.sort.each { |code, message|
puts "#{code} - #{message.gsub(/ /, "").underscore.to_sym}"
} if ActionController::StatusCodes.constants.include?('STATUS_CODES')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment