Rails

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

Posted by Weston Ganger on March 13, 2016

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:


Posted in Rails and Tagged with rails mime 


Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts