Check out example codes for "rails get current path". It will help you in understanding the concepts better.

Code Example 1

request.url
# => "http://localhost:3000/lists/7/items"
request.path
# => "/lists/7/items"

Learn ReactJs, React Native from akashmittal.com