You can view a demo of the modal window by starting the rails app in
Add the gem to your rails app Gemfile:
and run the bundle command:
Add the gem asset manifests: in your rails app application.js add:
//= require fs_browser/application
same goes in your rails app application.css:
*= require fs_browser/application
Include the modal html in any view of your application:
<%= render 'fs_browser/modal' %>
There are a few builtin callbacks available when interacting with the modal window:
- single click on a filesystem entry triggers
- double click on a filesystem entry triggers
- click on the submit button triggers
There are simple defaults for these callbacks that just log in the browser console.
Customize them by overriding methods in
The default starting path for the modal window is the root path of the filesystem ("/").
You can customise the behaviour adding an initializer in your app
config directory with
the following code:
FsBrowser::Path.root = '/some/other/path'
- Check workings on windows