May 24, 2017
Let us look on an example URL: On any site we can play in JS console with a location object. So we'll see an url contains of a protocol, hostname and a pathname. Saying about pathname it's this part: What we can say about this string it has sections separated by /. It means we can split by it and receive an array: Let's agree that first element section is a view name. Then make from the other elements an array of pairs: Which can be easily translated to a hash: You can treat this hash as an equivalent of Ruby on Rails params object which you use in Rails controllers. But here you use it in frontend components. Play it in console using those methods: and and or Read the code here. You can use it with any single page application outside Pro. If you need help just drop me a line. Have fun!