場所が表に追加されました。しかし、緯度/経度がありません。したがって、マップにマーカーは追加されません。
class Location < ActiveRecord::Base
validates :priority,:addr,:presence=>true
validates :priority,:numericality=>{:greater_than_or_equal_to =>1,:less_than_or_equal_to =>6}
default_scope :order=>'priority'
acts_as_gmappable :lat=>'lat',:lng=>'lng'
def gmaps4rails_address
self.addr
end
def gmaps4rails_infowindow
"<h4>Target priority: #{priority}</h4>" << "<h4>Address: #{addr}</h4>" << "<h4>Latitude: #{lat}</h4>" << "<h4>Longitude: #{lng}</h4>"
end
def gmaps4rails_marker_picture
{
"picture" => "/images/#{priority%7}.jpg",
"width" => "30",
"height" => "30"
}
end
end