0
J'ai dans mon contrôleur:Pourquoi url_for n'est-il pas rendu comme je le pense?
@statics = [{'home' => 'about'},
{'home' => 'termsandconditions'},
{'home' => 'information'},
{'news' => 'archives'}]
et à mon avis:
@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
les URL ne sont pas ce que j'attendais, par exemple
http://localhost:3000/homeinformation
au lieu de
http://localhost:3000/information
Cependant, je viens de faire cela, je reçois manuellement la bonne URL:
url_for(:only_path => false, :controller => 'brownies', :action => 'index') #works!
Qu'est-ce que je manque ici?
Ah, bravo. Ce dont j'avais besoin était un tableau de tableaux. en utilisant des hachages à tort .... – Kirschstein