-
-
Save rknLA/1955344 to your computer and use it in GitHub Desktop.
How to apply an override with Deface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Step 1: you need to add the files in say "app/overrides", ie: "/app/overrides/insert_this_here.rb" | |
# Step 2: add that in your application.rb to load them (and decorators) | |
config.to_prepare do | |
# Load application's model / class decorators (optional for Deface, but you should have it in your app if you use Spree AFAIK. | |
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c| | |
Rails.configuration.cache_classes ? require(c) : load(c) | |
end | |
# Load application's view overrides | |
Dir.glob(File.join(File.dirname(__FILE__), "../app/overrides/*.rb")) do |c| | |
Rails.configuration.cache_classes ? require(c) : load(c) | |
end | |
end | |
# Note that the :name of the deface has to fit the file name in that directory + .rb at the end of the file, but not in :name. ie: :name => "insert_this_here" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment