Friday, September 12, 2014

overriding spree javascripts

to overwrite spree javascripts, such as spree.js.coffee.erb,

first , enable assets path in config/application.rb

add:
config.assets.paths << "#{Rails.root}/assets"

Next, copy the assets file to the same directory path as the assets on spree.
eg.
spree / core / app / assets / javascripts / spree.js.coffee.erb
to:
assets/javascripts/spree.js.coffee.erb

Then run this on server, if its in production mode:
bundle exec rake tmp:clear

then restart the server,
thin restart, or what ever server you are using. you may stop and start.


if you need to add more file, you may edit:
vendor/assets/javascripts/spree/frontend (or backend) / all.js

hope it helps :)

No comments: