Why use gems for serving assets instead of the vendor file?

前端 未结 4 1116
余生分开走
余生分开走 2021-01-21 19:12

I am relatively new to Rails and I have a question about serving assets from a gem vs just loading the files into the asset pipeline.

As far as I can tell, they do virtu

4条回答
  •  时光取名叫无心
    2021-01-21 20:08

    Benefits:

    1. You don't need to manually copy them when you get a new version of jquery released, gem will make sure to add the latest codes only.

    2. Check this link: https://github.com/rails/jquery-rails/blob/master/lib/jquery/assert_select.rb#LC48 It provides couple of methods which helps while testing your code.

提交回复
热议问题