Skip to content

rapind/rails-themes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rails Themes

Plugin to provide theme support for Rails applications.

Install

Add to your Gemfile:

gem 'rails-themes'
# gem 'rails-themes', :git => 'https://github.com/fesplugas/rails-themes.git'

Usage

It expects the following folder structure.

app_root/
  public/
    themes/
      [theme_name]/
        views/
          layout/
          ...
        assets/
          images/
          javascripts/
          stylesheets/

You specify which theme to use in your controller by using the declarative theme syntax.

class ApplicationController < ActionController::Base
  theme "theme_name"
end

You can also defer the theme lookup to a controller method:

class ApplicationController < ActionController::Base

  theme :set_theme

  def set_theme
    request.domain
  end

end

Copyright © 2011 Francesc Esplugas, released under the MIT license

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published