Skip to content
lucasefe edited this page Feb 17, 2012 · 7 revisions

A theme, in ThemeForRails, is composed of two things:

  • Views: Haml, ERB, and so on.
  • Static Assets: Images, Stylesheets, Javascripts, etc.

So, in order to define a theme you need at least one of those things. The default structure of a theme looks like this:

$app_root
  themes/
    [theme_name]
      images/
      stylesheets/
      javascripts/
      views/           <- you can override application views
        layouts/         <- layout .rhtml or .liquid templates

But you can change this easily by adding an initializer file to config/initializers with the following:

# config/initializers/tfr.rb
ThemesForRails.config do |config|
  # your static assets on Rails.root/themes/pink/assets/{stylesheets,javascripts,images}
  config.assets_dir = ":root/themes/:name/assets" 
end

See more options visiting the Configuration’s Wiki Page.

Other documents

Clone this wiki locally