Humble suggestion to further extend r8785 (map... :as => 'something_else')


I was very excited to see that changeset, as I thought now I could use
more concise routes for my spanish applications. However, there is a
small remaining issue: action names.

For example, if I do map.resource :user, :as => 'usuario', I get the
following two routes:


That is weird. I want the following:


I could override named routes like this:

map.new_user 'usuario/nuevo', :controller => 'users', :action =>
'new', :conditions => {:method => :get}

But wouldn't it be nice if I could do something like:

map.action :new, :as => 'nuevo'

To override the 'new' action path on all controllers. And this (or
something less fugly):

map.resource :user, :as => 'usuario', :new => {:new => {:method
=> :get, :as => 'nuevo'}}

To override it on specific controllers.

Is this feasible?

Ivan V.

Is this feasible?

We could probably remove the hard-coded 'new' and 'edit' and replace
them with a configuration variable in the resources code. If you can
figure out a patch for this, please let us know. I don't think it
needs to be anything more advanced than:

config.action_controller.resources.path_names= {:new=>'nouveau',

Thanks for the reply.

It took me a while, but I was able to cook something up:

Anyone interested in testing this patch?

- Ivan V.