Permalink
Browse files

Step 5: Make the theme a gem so it can be distributed

  • Loading branch information...
1 parent 5f21cc5 commit 8ec6bdc73511cb8339ba13711bf0df795705a891 Carl Lerche committed Aug 26, 2009
@@ -1,11 +1,12 @@
+require "awesome_theme"
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
#START:auth
class ApplicationController < ActionController::Base
layout "store"
#...
- view_paths.unshift(RAILS_ROOT + "/app/themes/awesome")
+ include Themes::Awesomeness
#END:auth
before_filter :set_locale
@@ -5,6 +5,7 @@
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
+$:.unshift "#{RAILS_ROOT}/lib/awesome_theme/lib"
Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here.
@@ -0,0 +1,12 @@
+# These should be dependencies
+require "active_support/concern"
+
+module Themes
+ module Awesomeness
+ extend ActiveSupport::Concern
+
+ included do
+ view_paths.unshift(File.dirname(__FILE__) + "/views")
+ end
+ end
+end

0 comments on commit 8ec6bdc

Please sign in to comment.