Rails 4 app - where to add jQuery custom plugins and how to enable them

I am trying to add Raty to my rails 4 application, but I was wondering where I need to put it. I assume that the lib folder should just be placed on this path?

Provider / Assets / JavaScripts

And to use the script, I just do <%= javascript_include_tag 'vendor/assets/javascripts/jquery.raty' %>in my files? I want to be able to use it on multiple pages. Also, can I use script in .erb files or just plain html? Totally new to this, so any help is appreciated, thanks.

+4
source share
2

, app/assets/javascripts. script . , public/js , .

+1

vendor/assets/javascripts. application.js:

//= require jquery.raty

, . 8.3Kb.

+7

Source: https://habr.com/ru/post/1532195/


All Articles