Commit db5998b7 by Tute Costa

Merge pull request #2127 from bdewater/master

Update example to add mime-types to file extensions
parents cf409665 d20f7d28
......@@ -429,14 +429,13 @@ will not cause errors to be raised.
This can sometimes cause false validation errors in applications that use custom
file extensions. In these cases you may wish to add your custom extension to the
list of file extensions allowed for your MIME type configured by the `mime-types`
gem:
list of content type mappings by creating `config/initializers/paperclip.rb`:
```ruby
# Allow ".foo" as an extension for files with the MIME type "text/plain".
text_plain = MIME::Types["text/plain"].first
text_plain.extensions << "foo"
MIME::Types.index_extensions text_plain
Paperclip.options[:content_type_mappings] = {
foo: %w(text/plain)
}
```
---
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment