[typo] Hacking for static content

Trejkaz trejkaz at trypticon.org
Tue Jul 5 06:18:51 EDT 2005

Resurrected from the archive, Xavier said:
> Or just create a 'static' controller with one action per static page,
> then just put your static content in app/static/action_name.rhtml and
> use routes.rb to have cute URLs.  That way you can also leverage all
> the layout mechanism.

I've just implemented something very like this on my own local copy.  It looks 
like it _should_ be pretty simple:

class StaticController < ApplicationController
    def contact

But realistically, that won't actually work, it bombs out not being able to 
find the Category class.  Funnily enough, the following works:

class StaticController < ApplicationController
    def contact

This is all just temporary though.  Really, I was thinking that static pages 
should be stored in the database and CRUD via the admin interface.  I should 
get around to it and if/when I do I'll contribute back anything which doesn't 
suck. ;-)

Finally, does anyone have suggestions on how to manage this sort of hackery?  
For instance, if I just change the links on my site, I need to update 
app/views/shared/_links.rhtml, but then when the next version of Typo comes 
out it's bound to get squashed so I'd have to patch over my changes again.  
CVS wouldn't be quite enough... it's like I need some kind of patch-based 
versioning system.

Either that or we modify Typo until everything user-defined is in the database 
(including the theme?) ;-)


             Email: Trejkaz Xaoza <trejkaz at trypticon.org>
          Web site: http://trypticon.org/
         Jabber ID: trejkaz at jabber.zim.net.au
   GPG Fingerprint: 9EEB 97D7 8F7B 7977 F39F  A62C B8C7 BC8B 037E EA73
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/typo-list/attachments/20050705/18fb992c/attachment.bin

More information about the Typo-list mailing list