Catch Inconnu dans Rails 3 pour 404 personnalisée

Je veux attraper inconnu erreur dans Rails 3, qui illustre "Inconnu" erreur sur le développement et la 404.html sur la production. J'ai essayé de mettre ce rescue_from gestionnaire sur mon ApplicationController (et aussi sur un contrôleur, juste au cas où) mais je vois encore le vilain erreur.

J'ai coutume de choses sur la 404, et il ne peut pas être simple .fichier html.

Mon itinéraire:

match '/user/:id/:action', controller: 'users'

L'URL je suis accès: /user/elado/xxx

La rescue_from code:

rescue_from AbstractController::ActionNotFound, :with => :action_not_found

def action_not_found
  render text: "action_not_found"
end

L'erreur dans le navigateur:

Unknown action

The action 'xxx' could not be found for UsersController

Et dans la console:

Started GET "/user/elado/xxx" for 127.0.0.1 at 2011-09-07 19:16:27 -0700

AbstractController::ActionNotFound (The action 'xxx' could not be found for UsersController):

Essayé aussi rescue_from ActionController::UnknownAction.

Des suggestions?
Merci!

OriginalL'auteur elado | 2011-09-08