Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Internet File Manager - Rails 2.3.8
Ruby JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
db
doc
features
lib
log
public
script
spec
test
tmp
vendor/plugins
.gems
.gitignore
Capfile
Gemfile
README.rdoc
Rakefile
test.sqlite3

README.rdoc

Internet File Manager

Updates 08/29/2010


This is my Internet File Manager app that I had put out on Rails 2.3.5. I have upgraded it to Rails 2.3.8 as a stepping stone for eventual upgrade to File Manager for Rails 3. This app works, has bundler support etc. and uses Rails 2.3.x compatible gems. Looking back, I would not have bothered to upgrade my Rails 2.3.5 app to Rails 2.3.8, but that is all water under the bridge now :) My advise would be to go straight to Rails 3.0.0 RC2.

Please note that a few of the cucumber features will fail since they need amazon aws keys to operate correctly. Please substitute appropriate key values and they should work fine. The shoulda tests, both units and functionals work fine.

This is a Rails 2.3.8 application used to manage files over the web in a distributed environment. It has been extracted from an application that is in production, so it works in real-life. My motivation in releasing it is to share knowledge and put something back in the Rails community.

Briefly, it lets you organize files in a hierarchy of “Clients -> Folders -> Documents.” The folders can be nested within folders to an arbitrary depth. It comes with four pre-defined roles for users. Each role can have multiple users.

  1. admin - has full access to everything in the application.

  2. leader - can access everything except the administrative sections.

  3. staff - can only access clients/folders for which they have been assigned permissions by the admin

  4. eclient - or External Client - the aforementioned first three roles, i.e., admin, leader, and staff

are considered internal and can access any Clients' account and folders with the caveat that staff users may have restricted permisssions. External client users, on the other hand, can only access their own client accounts (the admin sets up the accounts). There can be multiple user accounts assigned to the same external client.

Setup

  • Git clone the project using the URL from github.

  • config/environment.rb has a list of gems used in the project. If I have missed anything, let me know.

  • There are several plugins used that can be moved to gems. I will do that most likely for the Rails 3 upgrade.

  • The application is setup to use MySQL and has been developed on Ubuntu, though, it has been sparsely tested in Windows.

  • Create MySQL database: I called it file_manager_dev (pick any name and update database.yml accordingly).

  • Run rake db:migrate from Rails root - creates the database schema

  • Run rake db:seed from Rails root - creates seed data in reference tables

  • Run rake db:populate from Rails root - populates the clients and folders tables with example data

Note that the above three commands can be packaged as one rake task, e.g., setup, and I tried (see lib/tasks/application.rake), but for some reason it does not work. May be someone with better knowledge of Rake can point out?

  • Thinking Sphinx setup - I had diabled it for the move to Heroku. I will reenable it but only for Rails 3.

  • To run the Shoulda tests - type rake test from Rails root.

  • to run the Cucumber tests - type cucumber features from Rails root.

The application bootstraps the seed data,e.g., roles, minimum number of users, and a few lookup tables. Feel free to customize them except the roles that are hard-wired in the application at the moment. I am thinking of using Ryan Bates's cancan to centralize authorization logic, but haven't done it yet.

Gems and Plugins

The application uses several useful tools that can be used as a learning example:

References

Tools

  • Vim Excellent screen-casts at peepCode.

  • Books - too many to mention here :) www.amazon.com

Demo App (Please note that the demo app still uses Rails 2.3.5, so try it only for testing purposes)

I have deployed a demo app on Heroku at the following URL: empty-fog-47.heroku.com login with the following userid/password combination for various roles: Admin Role - system/important Lead Role - leader/leader Staff Role - staff/staff

See the db/seeds.rb file if you need more explanation

Note for the demo app - since I did not want to deal with the SSL issues on Heroku free account, I have commented out the ssl related code in the following files:

application_controller.rb user_sessions_controller.rb users_controller.rb

Caution!

The application has been extensively tested in Firefox only. Your milage will vary with other browsers, especially Internet Explorer!

License

Released under the MIT license. Not responsible for errors. Use at your own risk.

Contact Info

Bharat Ruparel bcruparel@yahoo.com

Something went wrong with that request. Please try again.