:: is a scope resolution operator (i.e. a namespace operator) in many languages, including C ++ and Ruby, so it is not specific to Rails.
In Ruby, modules define namespaces, so you can see code like this:
Net::HTTP.get 'stackoverflow.com'
Which calls the get class method of the HTTP class in the Net module.
In Rails, namespaces allow you to better organize your code (for example, to separate your API controllers from the rest) and are implemented as modules.
source share