test of sites, themes, and editable layouts in rails 3
Ruby JavaScript CoffeeScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
config
db
doc
lib
log
public
script
spec
test
themes
vendor
.gitignore
.rspec
.rvmrc
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru

README.md

Sites and Themes

in Rails 3

Requirements

  • Sites can be looked up by permalink
  • Each site has a theme
  • Themes can override default rails views, supporting erb, haml, etc
  • Admins can safely edit the site layout in the browser
  • Layout editing cannot kill the cache

Solutions

  • each theme gets a view directory that overrides the default directory
  • layouts are edited using liquid
  • layouts are split into two pieces, pre_content and post_content
  • layout pieces are served up via ESI tags in production
  • layout pieces are served up via ajax in development