How to use javascript_include_tag to get all scripts in a folder

前端 未结 4 728
走了就别回头了
走了就别回头了 2021-02-08 18:13

I\'d like to use javascript_include_tag to grab all view related scripts using recursion, which a placed in public/javascripts/views.

I\'m tryi

4条回答
  •  暖寄归人
    2021-02-08 18:45

    A simple solution is to create a new js-file ( further called activate.js ) and include the files there.

    # < FolderWithFiles >/activate.js :
    
    //= require_tree . 
    

提交回复
热议问题