How to use javascript_include_tag to get all scripts in a folder

前端 未结 4 732
走了就别回头了
走了就别回头了 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:49

    You can use

    <%= javascript_include_tag :all %>
    

    But this will work only if the scripts are stored in your

    RAILS_ROOT/public/javascripts
    

    directory

提交回复
热议问题