WebDAV on Rails
May 8th, 2006 A little treat for you all. As part of a larger project i've been working on, i've created a plugin for Rails which allows for controllers to handle "WebDAV":http://www.webdav.org/ requests. At the moment it is only working for Rails 1.0 but i'll work on upgrading it. It's still only beta, has a few problems and doesn't do the whole spec, which is massive. But it's a good start. WebDav controllers can be registered by:
class DavController < WebDavController
set_rails_webdav_root "directory_path"
set_max_propfind_depth 1
end
This will allow a directory under RAILS_ROOT to be accessible via WebDAV.
You can also register callbacks to handle the assets after a request
def after_webdav_put
logger.info("got a new file #{@file_path}")
end
WebDAV is great and a Rails implementation will allow exposing not just files but a file-system representation of your data and system to users.
Anyway i'll release the code soon but for now "here is a video":/assets/2007/2/4/WebDavOnRails.mov