类VenuesController< ApplicationController中
def index
@search = Venue.search(params[:search])
@venues = @search.all(:order => "name ASC")
@json = @search.all.to_gmaps4rails do |venue, marker|
marker.infowindow render_to_string(:partial =>“info”,:locals => {:object => venue}) marker.picture({ :picture => “图像/#{name}的巴纽” :width => 32, :height => 32 })
端
respond_to do |format|
format.html # index.html.erb
format.json { render json: @venues }
end
端
答案 0 :(得分:0)
您的部分不起作用,因为它需要名为venue
的变量。
在您的控制器中,尝试将您的本地哈希值更改为:locals => { :venue => venue }
:
marker.infowindow render_to_string(
:partial => "info",
:locals => {
:venue => venue
}
)
marker.picture({
:picture => "images/#{name}.png",
:width => 32,
:height => 32
})
对于您的标记图片,您的错误是什么?
第h