Using Rails Service Objects to Keep Code Clean
If you’re developing web apps using Ruby on Rails, you probably already know that Rails is an MVC (Model-View-Controller) framework, which means that you have your Models responsible for data, Views responsible for templates and Controllers responsible for requests handling. But the bigger your app gets, the more features it has - the more business logic you will have. And here comes the question, where do you put your business logic?
Building Responsive Rails Apps with Hotwire
Using Redis for Geospatial Data
Working with geospatial data is notoriously difficult, because latitude and longitude are floating point numbers and should be very precise. In addition, it would seem that latitude and longitude can be represented as a grid, but in fact they can’t, simply because Earth is not flat and math is hard. For example, to determine the distance of a great circle between two points on a sphere, based on their latitude and longitude, the haversine formula is used, which looks like this: