Skip to content

Commit 1db7aa0

Browse files
committed
Update READMECustomize example
2 changes on it: 1. `Task.new` needs to receive the Rails.application 2. Need to clear the tasks generated before, otherwise it will run the old and the new ones.
1 parent c05a6f4 commit 1db7aa0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ You can also redefine the task with the built in task generator.
3737

3838
``` ruby
3939
require 'sprockets/rails/task'
40-
Sprockets::Rails::Task.new do |t|
40+
# clean the old tasks
41+
Rake::Task["assets:environment"].clear
42+
Rake::Task["assets:precompile"].clear
43+
Rake::Task["assets:clean"].clear
44+
Rake::Task["assets:clobber"].clear
45+
Sprockets::Rails::Task.new(Rails.application) do |t|
4146
t.environment = lambda { Rails.application.assets }
4247
t.assets = %w( application.js application.css )
4348
t.keep = 5

0 commit comments

Comments
 (0)