Answer the question
In order to leave comments, you need to log in
RAILS and assets J?
Hello, but how to freely organize the binding to View javascript. Now I create a file in app/assets/javascripts/ for each View. And then already in the file itself I check for the presence of the main element.
Or is there a more elegant way? Thanks
$( document ).on 'turbolinks:load', ( ) ->
$ioCorrectionProducts = $( '#io_correction_products' )
if $ioCorrectionProducts.length
# делаем настройки и привязки к элементам
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question