Ruby on Rails create a dynamic asset -


i'm making small gem me out further development creates small javascript function based on database resutls. piece of javascript must added page somehow i'm not sure of best way of doing it.

do assets pipeline have magic code can add javascript/css code somehow? checked docs found nada yet.

in gemfile:
place js file in vendor/assets/javascripts in application
add file app/assets/javascripts/application.js lines:

#= require your_js_file_name 

if have dynamic pieses of code add extension .erb js file
example: your_js_file_name.js.erb


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -