Expose asset_path helper to JavaScript


was going to ask the question, but found the solutions in a last minute :smile:

Here it is:

Also some gists:
javascript asset helper 1
javascript asset helper 2

Is there other options?

I’m aware of prepending *.erb, but I don’t like.

Have a look at gon gem. Haven’t used it but it should do the job.

The gist I found and particularly js_assets gem is much easiest solution :wink:

With “gon” you still have to index assets and add corresponding JS helper, i.e. way too much job :smile: