The maze book for programmers!
Algorithms, circle mazes, hex grids, masking, weaving, braiding, 3D and 4D grids, spheres, and more!
Mike Clark has got a great writeup on how to create custom maintenance pages for use with Capistrano and Apache. I haven’t seen much written where people are using the render helper in Capistrano—it’s good to see it getting some use, anyway!
We’re using the render helper to produce a customised dispatch.fcgi, so that the correct ruby binary is added at the top in the #! string, regardless of which server we’re deploying too and how it might differ from our development environments (we develop on Windows, Linux and Mac).
I’ve recently built a recipe to create apache / mongrel / monit configurations with the use of the render helper. It’s very sweet to be able to create new installations without really having to touch the server. This was heavily inspired by work done by members of Copenhagen.rb which have done something along the same lines.
Is there a way to link to your app’s stylesheet in the maintenance.rhtml page? I get a Capistrano error if I try to use <%= stylesheet_link_tag %> and using the straight HTML syntax fails too, presumably because the Apache rewrite rules redirect all requests to maintenance.html…?
John, the template is not evaluated using any Rails helpers, so the stylesheet_link_tag helper isn’t available. If you want to use an external stylesheet, you’ll need to use straight HTML, and then tweak your apache rewrite rules to allow stylesheets to be accessed.
Thanks Jamis, that’s what I thought.
These articles lovingly written and prepared for your reading
pleasure by Jamis Buck <email@example.com>. Follow me on Twitter and stalk my code at GitHub.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.