-
Notifications
You must be signed in to change notification settings - Fork 2.3k
CarrierWave
drale2k edited this page Jan 31, 2012
·
15 revisions
Automatically detected.
Your model should look like this:
class Article < ActiveRecord::Base
mount_uploader :asset, AssetUploader
# don't forget those if you use :attr_accessible (delete method and form caching method are provided by Carrierwave and used by RailsAdmin)
attr_accessible :asset, :asset_cache, :remove_asset
end
You also need to specify the field as a 'carrierwave' type:
field :asset, :carrierwave
Now a file upload field will be added to your model's form.