← Back to Upcase

Expose asset_path helper to JavaScript

(Yevgeniy Viktorov) #1


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.

(Lenart Rudel) #2

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

(Yevgeniy Viktorov) #3

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: