How To Get A List Of All Currently Registered MIME Types With Rails

Posted by Weston Ganger

Rails was complaining about mime types already registered, so I wanted to check what MIME types were already registered in my app.

We can do this easily through Rails console.


# List all registered
Mime::EXTENSION_LOOKUP.map{|x| x}

# Or Check for a specific type
Mime::Type.lookup_by_extension(:pdf)


Related External Links:

Article Topic:Software Development - Rails

Date:March 13, 2016

Recommended Posts

Contact

604-309-8713
info@solidfoundationwebdev.com

Send Me A Message

I would love to get in touch and talk about your next project. Feel free to send a message and I will get back to you shortly.

Get Connected