This is a filemanager for ruby on rails. It works right away with CKEditor.
See demo at: filemanager-demo.herokuapp.com
-
Add this to your gemfile:
gem "rails_filemanager"
-
Run the generator:
rails generate rails_filemanager:install rake db:migrate
-
Now mount the filemanager in your routes:
# config/routes.rb mount RailsFilemanager::Engine => "/filemanager"
You can now find the filemanager at /filemanager
Use the method check_authorization to ensure that a user is logged in:
# config/initializers/rails_filemanager.rb def check_authorization raise "unauthorized" unless session[:admin] end
The filemanager uses paperclip for storing the files. You can use your own storage options, if you want to use amazon s3 for instance:
# config/initializers/rails_filemanager.rb RailsFilemanager::Engine.config.paperclip_storage_options = { storage: :s3, bucket: "static.example.com", s3_host_alias: "static.example.com", url: ":s3_alias_url", path: ":attachment/:id/:style/:basename.:extension", s3_credentials: { access_key_id: "ACCESSKEY", secret_access_key: "SECRET" } }
The default translation is:
rails_filemanager: upload: "Upload files" delete: "Delete %{filename}?"
Say, if your app speaks spanish, you could use this example:
# config/locales/es.yml rails_filemanager: upload: "Upload archivos" delete: "¿Eliminar %{filename}?"
-
Organize in folders
-
Custom javascript callback
-
Adding unit tests
This project rocks and uses MIT-LICENSE. <<<<<<< HEAD
Uploadify: www.uploadify.com/mit-license/
Paperclip: github.com/thoughtbot/paperclip#license
>>>>>>> baf16fe1f2677143989f07591bd3b265dcd2b844