专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Ruby/Rails

relative_url_root哪位高手用过

发布时间:2011-06-29 18:42:24 文章来源:www.iduyao.cn 采编人员:星星草
relative_url_root谁用过 求助
can't convert nil into String

Extracted source (around line #11): 

8: xml.link topic_url(@forum, @topic)
9: xml.language "en-us"[:feed_language]
10: xml.ttl "60"
11: xml.tag! "atom:link", :rel => 'search', :type => 'application/opensearchdescription+xml', :href => "http://#{request.host_with_port+ActionController::Base.relative_url_root}/open_search.xml"
12: xml.description @topic.body
13: 
14: render :partial => "layouts/post", :collection => @posts, :locals => {:xm => xml}


原来的代码是request.relative_url_root 但我查自己的API发现没这个方法 网上说2.2后移到了ActionController::Base里 我试了结果取不到值了 我的环境是rails2.3.5 求帮助 在线等



------解决方案--------------------
旧版中用的是 request.relative_url_root方法

新版中用的是 ActionController::Base.relative_url_root方法,如果你的环境是 2.3.5,这个方法是可以用这个方法的。具体看是不是这个环境的,你要仔细检查下你的环境配置environment.rb 。
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: