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

3 Responses to “WebDAV on Rails”

  1. Adrian Madrid Says:

    Stuart,

    That sounds very interesting. Just googling I found a little library that worked with Webrick to do WebDAV but yours is much more interesting to me. I always thought that adding WebDAV to a Rails CMS would be great. Specially if you can integrate it with DreamWeaver. Can’t wait for your release!

    AEM

  2. rot Says:

    sounds very nice to mee too – i have just been thinking about this as the ultimate cms file solution. i´v been using webdav via svn-webdav-apache2 for half a year for handling the files in a rails apllication (http://p2.granul.at) and i´m very content with it. You can mount the webdav-directory on any os without pain – which is really nice – especially when you are working with people less freakish.

  3. Frank Says:

    Still waiting for the code release…

    Cmon, people are waiting for this ^^

Sorry, comments are closed for this article.