I'm looking at the default file placed in /config/initializers/assets.rb
in a Rails 5 app.
To precompile code, Rails inside the comments, gives a pre-existing code to precompile assets together.
Rails.application.config.assets.precompile += %w( search.js )
I am curious what the last part means: += %w( search.js )
, as I have never seen the expression (+= %w
) used in Ruby or Rails. I know that the entire line is calling the Rails class, chaining some methods together to create the end output. But I am curious, what does the += %w do, and how is it affecting what I presume to be the argument (search.js
)?