2010-12-09 3 views
0

J'essaie d'améliorer le projet i18n sur mes rails. La navigation fonctionne bien, mais j'ai déjà un bug avec les formulaires.erreur de forme avec i18n sur les espaces de noms

config/routes.rb

map.namespace :admin, :path_prefix => '/:locale/admin' do |admin| 
    admin.resources :titles 
end 

map.connect ':locale/:controller/:action/:id' 
map.connect ':locale/:controller/:action/:id.:format' 

app/views/admin/titres/_form.html.haml

- form_for([:admin, title], :url => {:id => title}) do |f| 

Formulaire charge le dossier droit, je peux voir les informations correctes mais quand Je sauvegarde (post action) il soulève cette erreur

ActiveRecord::RecordNotFound in Admin/titlesController#1 

{"commit"=>"Submit", 
"title"=>{"price"=>"69.95", 
"title"=>"Java How to Program", 
"isbn"=>"0130125075", 
"available"=>"0", 
"copyright"=>"2000", 
"author_id"=>"1", 
"edition"=>"3", 
"publisher_id"=>"1"}, 
"_method"=>"put", 
"authenticity_token"=>"PmuWctSaS2JXYIG8EdjS9Y7VOK48sThiOTSn+4+gHLY=", 
"id"=>"edit", 
"locale"=>"en"} 

Qu'est-ce que je fais mal?

Répondre

0

Peut-être que si vous donnez une information plus précise sur url pour votre aide form_for

- form_for([:admin, title], :url => url_for(:controller => 'admin/titles', :action => :update, :locale => params[:locale], :id => title)) do |f|