Repository is archived
No commit activity in last 3 years
No release in over 3 years
RailsFilemanager ajax is a mountable engine aiming to provide simple integration with existing application needing a file manager.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

RailsFilemanager

RailsFilemanager ajax is a mountable engine aiming to provide simple integration with existing application needing a file manager.

Currently it supports file owners and owners' maximum storage space. The files are organized in a tree-like structure.

NOTE: As this gem is in active development, this readme is given primarily as a reminder for myself since most of the stuff described will change daily.

Instalation

Add this line to your Gemfile

gem 'rails_filemanager_ajax', git: "https://github.com/makkrnic/rails-filemanager-ajax.git"

Mount the engine

mount RailsFilemanager::Engine => "/rails_filemanager"

Run the migrations

bundle exec rake rails_filemanager:install:migrations
bundle exec rake db:migrate

In the ApplicationController define the method current_owner. This will change in the future.

An example of such method is:

def current_owner
    Owner.find_by params[:owner_id]
end

In the model you want to be owner of files add the following snippet:

include RailsFilemanager::ActsAsFilemanagerOwner

acts_as_filemanager_owner storage_limit_method: :my_method

And, of course, define the method you want to use.

User authorization

If you want to allow or deny file managing, you should implement the method user_can_manage_files? in your application controller.

In the future, that will be changed to something smarter.

TODO

  • tests