How do I do geocoding and routing with OpenStreetMap? [closed]

Routing MapQuest open offers an Open Directions Service and an Open Guidance Service. Additional information about Routing in OpenStreetMap can be found in the Routing article on the OSM wiki. Geocoding Cloudmade’s Web Maps API includes a geocoder. The geocoders currently used on OpenStreetMap’s main site are Nominatim and GeoNames. There is now also an … Read more

How to write controller tests when you override devise registration controller?

The problem is that Devise is unable to map routes from the test back to the original controller. That means that while your app actually works fine if you open it in the browser, your controller tests will still fail. The solution is to add the devise mapping to the request before each test like … Read more

Where’s root_path or root_url?

These helpers exist, but you have to set your root url before, in config/routes.rb: root :to => “controller#action” You can use root_url and root_path afterwards. Be warned that there’s a catch when doing redirections with the _path helpers, you should use the _url ones when redirecting (see @LanguagesNamedAfterCoffee’s comment for the details).

Angular router url returns slash

Instead of trying to use Router (which is not ready to give you final route at this moment of navigation lifecycle), you can use Location service (https://angular.io/api/common/Location) and its method path, which will give you the url without base href. On the contrary, window.location.pathname is not aware of your angular toys and will give you … Read more

tech