0
我有這個在我的控制器:爲什麼不是url_for渲染這個像我認爲它應該?
@statics = [{'home' => 'about'},
{'home' => 'termsandconditions'},
{'home' => 'information'},
{'news' => 'archives'}]
在我看來:
@statics.each do |controller, action|
xml.loc url_for(:only_path => false, :controller => controller, :action => action)
xml.lastmod w3c_date(Time.now)
xml.changefreq "weekly"
xml.priority 0.8
end
的網址是不是我所期望的,例如
http://localhost:3000/homeinformation
代替
http://localhost:3000/information
不過,我只是手動這樣做,我得到正確的網址:
url_for(:only_path => false, :controller => 'brownies', :action => 'index') #works!
缺少什麼我在這裏?
啊,歡呼聲。我需要的是一組數組。錯誤地使用哈希... – Kirschstein 2010-10-11 21:08:02