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

Socket.connect doesn't throw exception in Android -

SPSS keyboard combination alters encoding -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -