Posts

Showing posts from August, 2015

Address already in use - bind(2) for 127.0.0.1:3000

you need use kill -9 4343 (use lsof -wni tcp:3000 to see which process used 3000 port and get the process pid)

Find places close by a route using Google Maps API V3 and RouteBoxer

<div id="google_map" class="google_map" style="width: 750px; height: 500px;"></div> <script src="//maps.googleapis.com/maps/api/js?v=3.2&amp;sensor=false"></script> <script src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/routeboxer/src/RouteBoxer.js"></script> <script type="text/javascript">   //placing a marker on the map function createMarker(map, coords, title) {  var marker = new google.maps.Marker({   position: coords,   map: map,   title: title,   draggable: false  });  return marker; } //Search places having coordinates inside the boxes function findPlaces(boxes) {  var data = "";  for (var i = 0; i < boxes.length; i++) {   //form the query string that will be sent via ajax   if (data != "") {    data += "&";   }   data += "boxes[]=" + boxes[i].getNorthEast().lat() + ":" + boxes[i].getNorthEast().l

disable inherited_resources in ruby on rails

Solution 1 config . app_generators . scaffold_controller = :scaffold_controller Solution 2 config . generators do | g | g . scaffold_controller "scaffold_controller" end Solution 3 To force rails to use the normal scaffold generator, add -c=scaffold_generator to the end of the command