Module: ThemesForRails::Routes

Included in:
ActionDispatch::Routing::Mapper
Defined in:
lib/themes_for_rails/routes.rb

Instance Method Summary collapse

Instance Method Details

#themes_for_railsObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/themes_for_rails/routes.rb', line 5

def themes_for_rails
  theme_dir = ThemesForRails.config.themes_routes_dir
  constraints = { :theme => /[\w\.]*/ } 
  
  match "#{theme_dir}/:theme/stylesheets/*asset" => 'themes_for_rails/assets#stylesheets', 
    :as => :base_theme_stylesheet, :constraints => constraints
  match "#{theme_dir}/:theme/javascripts/*asset" => 'themes_for_rails/assets#javascripts', 
    :as => :base_theme_javascript, :constraints => constraints
  match "#{theme_dir}/:theme/images/*asset" => 'themes_for_rails/assets#images', 
    :as => :base_theme_image, :constraints => constraints
end