SammyLin / redactor-rails

This repo is deprecated. Please check out official gem for Redactor 2. https://github.com/Redactor2/redactor2_rails
MIT License
389 stars 253 forks source link

How to delete uploaded images? #80

Open Allanon29 opened 11 years ago

Allanon29 commented 11 years ago

After I've uploaded an image through the editor I can select and insert it again into the same or into another post from the choose image menu. But how can I delete an image for example from an admin interface like Active Admin? Or from the image list pop-up window as a regular user?

ItalianChef commented 10 years ago

Redactor itself does not provide means to upload and manage pictures or files. Rather, Redactor provides interfaces and requires to implement a handler that handles the selected files for upload. The redactor-rails Gem provides such uploader via CarrierWave gem.

I would recommend to override the two controllers, PictureController and DocumentController, that are provided by the gem and implement the required show and destroy actions. Alternatively, an own controller could be designed and implemented which handles the records for the Redactor assets. Check the schema.rb file for redactor_assets table.