J'ai le code de contrôleur suivant:
def create
@admin = Admin.new(params[:admin])
respond_to do |format|
if @admin.save
redirect_to(@admin, :notice => 'Admin was successfully created.')
else
render :action => "new"
end
end
end
def update
@admin = Admin.find(params[:id])
respond_to do |format|
if @admin.update_attributes(params[:admin])
redirect_to(admin_admins_path, :notice => 'Admin was successfully updated.')
else
render :action => "edit"
end
end
end
et les itinéraires suivants:
admin_admins GET /admin/admins(.:format) {:action=>"index", :controller=>"admin/admins"}
admin_admins POST /admin/admins(.:format) {:action=>"create", :controller=>"admin/admins"}
new_admin_admin GET /admin/admins/new(.:format) {:action=>"new", :controller=>"admin/admins"}
edit_admin_admin GET /admin/admins/:id/edit(.:format) {:action=>"edit", :controller=>"admin/admins"}
admin_admin GET /admin/admins/:id(.:format) {:action=>"show", :controller=>"admin/admins"}
admin_admin PUT /admin/admins/:id(.:format) {:action=>"update", :controller=>"admin/admins"}
admin_admin DELETE /admin/admins/:id(.:format) {:action=>"destroy", :controller=>"admin/admins"}
Maintenant, mis à part la dénomination légèrement whacky - les redirections entraînent toujours un 406 Inacceptable. Quel pourrait être le problème?