Based on the response of apneadivings, two possibly shorter ways come to mind:
Generic:
def gmaps4rails_marker_picture
{
"picture" => self.image_path,
"width" => 32,
"height" => 32
}
end
:
def gmaps4rails_marker_picture
{
"picture" => "/images/" + self.category + ".png",
"width" => 32,
"height" => 32
}
end
, , . , , .