1. How does it work?
When we start our Rails server, the first request will generate a cache for rwr-view_helpers in the form of json & js files with hash mapping assets’ urls to urls with a generated digest-hash.
The .gif, .jpg, .png file extensions are supported by default. More can easily be added, according to the user’s needs.
2. How to install it?
The installation of helpers is really straightforward, all you have to do is:
install it with npm:
$ npm install --save rwr-view-helpers
add the gem to your Gemfile:
$ gem 'rwr-view_helpers'
require the js file in application.js:
3. How to use it?
Using helpers is extremely easy - they’re simply exported as a function from our node module:
$ rake tmp:clear
While, at the moment, there is only imagePath helper - we are looking forward to adding more. If you are missing something you really need, let us know or, even better, open PR!
5. Future updates
We’re currently working on automating the cache generation process with assets watcher, so make sure to star our repo and stay tuned for amazing updates in the near future.