How to display controller specific javascript in rails 3.1?

前端 未结 5 777
我在风中等你
我在风中等你 2020-12-31 14:20

I have my assets folder structure like this

assets
  javascripts
    products
      --product.js
      --productValidate.js
    store
      --store.js
         


        
5条回答
  •  悲&欢浪女
    2020-12-31 14:47

    As far as I know assets pipilene is something that should be precompiled. So... conceptually it should take all files at once and return just one copiled file, and it is good for caching.

    You can store them somewhere out od assets (in puplic, as older Rails do, for example) and include it in depending to current controller and action

提交回复
热议问题