sprockets

https://github.com/rails/sprockets

Ruby

Rack-based asset packaging system

Sprockets::Context#root_path

Returns the environment path that contains the file.

If `app/javascripts` and `app/stylesheets` are in your path, and
current file is `app/javascripts/foo/bar.js`, `load_path` would
return `app/javascripts`.

Source | Google | Stack overflow

Edit

git clone [email protected]:rails/sprockets.git

cd sprockets

open lib/sprockets/context.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Sprockets--Context-root_path-for-pr


# Commit to git

git add lib/sprockets/context.rbgit commit -m "better docs for Sprockets::Context#root_path"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Sprockets--Context-root_path-for-pr

hub pull-request


# Celebrate!