-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Saving Content Type
Adam Jahn edited this page Apr 14, 2017
·
2 revisions
If you need to save content type in your model, you could use this:
require 'carrierwave/processing/mime_types'
class MyUploader < CarrierWave::Uploader::Base
# include CarrierWave::MimeTypes
# ^ Include MimeTypes for CarrierWave versions < 1.0.0
process :save_content_type_in_model
def save_content_type_in_model
# replace `file_content_type` with your field name
model.file_content_type = file.content_type if file.content_type
end
end