Nick Ginanto
Nick Ginanto

Reputation: 32160

Purpose of Rails lib/assets

Pretty much everywhere quotes the Rails Guides

lib/assets is for your own libraries' code that doesn't really fit into the scope of the application or those libraries which are shared across applications.

Thats great, but what does it mean?

If it is my library, I would either use a gem or bower (which will install in vendor). Why would I manually put things in lib/assets that are shared across applications and have them included in the repo? Sound like a mess..

Would love a concrete example of things that should go into lib and not vendor

Upvotes: 5

Views: 2268

Answers (1)

steel
steel

Reputation: 12540

If the code is internal, written by you, your team or your company, and it is shared between projects (or is a clearly discrete library within your project) but not added to a gem or a bower package because it is not publicly distributed, you might want to add it to lib/assets.

You may also choose to put a stable, discrete file or folder of assets, like a piece of JS functionality, that is only for this app, into lib/assets, to indicate it is more stable than other code.

Upvotes: 5

Related Questions