Can anyone explain what the use of the following directories is?
These directories are all a part of Rails' Asset Pipeline.
app/assets directory is for your application assets (for instance, the stylesheets and images for your application).
vendor/assets is meant to house all third party libraries (e.g. jQuery).