I'm using gmap4rails
in my application which says to specify a marker you should define a method in your model. But how can i get full image url for that?
Now I have the following code in my model
def gmaps4rails_marker_picture
{
"picture" => helpers.asset_path("marker.png"),
"width" => 20,
"height" => 33
}
end
def helpers
ActionController::Base.helpers
end
But this only give me path for an image?
I've also tried to do it like this
Rails.application.routes.url_helpers.root_url + helpers.image_path("marker.png")
but that gives me an error:
Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
Any way to make this work?