我正在尝试用gmaps4rails gem创建一个示例项目:但是得到了一个错误:
undefined method `gmaps’ for #
Rails.root: /var/www/brandbk
Application Trace | Framework Trace | Full Trace
app/controllers/locations_controller.rb:46:in `block in create’
app/controllers/locations_controller.rb:45:in `create’
Request
Parameters:
{“utf8″=>”вњ“”,
“authenticity_token”=>”CSpi+VhUe8CtF+4R6zxMEXbB8ofa0QxUF1ntGl+N1Ss=”,
“location”=>{“address”=>”rwr”},
“commit”=>”Create Location”}像这样:http://pastebin.com/zGP9Z7vE,有人能帮我吗?
我的模型和控制器是有效的,并且与项目wiki中描述的相同。谢谢。
发布于 2011-05-24 05:49:25
它来自这里:
return true if gmaps4rails_options[:check_process] == true && self.send(gmaps4rails_options[:checker]) == true基本上,如果出现以下情况,此行将阻止地理编码:
所以有两种方法可以摆脱它:
check_process设置为falsegmaps的模型中(也可以使用方法完成此操作)这里有更多详细信息:https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Model-Customization
https://stackoverflow.com/questions/6103384
复制相似问题