On Tue, Dec 20, 2011 at 11:19, Paul van Tilburg <p...@luon.net> wrote: > On Tue, Dec 20, 2011 at 11:06:09AM +0100, Isak Andersson wrote: >> I think Alternative 2 makes the most sense. Then you can have multiple apps >> that don't share the public folder. Plus, you put almost everything in the >> app folder anyways so there shouldn't be a difference now either. >> >> >Alternative 2: >> > >> > app.rb >> > app/public >> > app/public/style.css # example > > I disagree. In most cases there is only one app (at least for most of > my apps). So I have an app.rb with stuff under public/. > > If there are more apps, there is no way of knowing whether they are > designed to work together and share the same public data, or they are > apps with seperate(d) public data. Since one has to build the URLs in > the app anyway, why not let the developer decide the layout of public/ > to suit a shared or seperated layout? (One can think of shared > stylesheets, but different sets of icons/PDFs/whathaveyou). >
I think this makes most sense too. If you have this config.ru: require 'app' require 'app2' map '/app' do run App end map '/app2' do run App2 It's much easier get a consistent setup in production and development with a single shared public directory. With separate directories you now need to configure your web server to: 1. Serve static files at app/public as /app/ 2. Serve static files at app2/public as /app/2 3. Serve everything else to Thin/Mongrel/WEBrick -- Well, running multiple-apps in one process is kinda broken anyway, because Camping overrides Markaby to prepend the root to all src-, href- and action-attributes: link rel: 'stylesheet', href: '/style.css' If you have mounted that app at /app, then it will actually generate <link rel="stylesheet" href="/app/style.css">. So you're pretty much stuck within your app anyway… _______________________________________________ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list