Ivan el Magnifico
2008-Feb-12 21:57 UTC
Humble suggestion to further extend r8785 (map... :as => ''something_else'')
Hi, 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: /usuario/new /usuario/edit That is weird. I want the following: /usuario/nuevo /usuario/editar 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? Regards, Ivan V. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Koziarski
2008-Feb-16 04:47 UTC
Re: Humble suggestion to further extend r8785 (map... :as => ''something_else'')
> 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'', :edit=>''modifier} -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Ivan el Magnifico
2008-Feb-20 22:29 UTC
[PATCH] Re: Humble suggestion to further extend r8785 (map... :as => ''something_else'')
Thanks for the reply. It took me a while, but I was able to cook something up: http://dev.rubyonrails.org/ticket/11181 Anyone interested in testing this patch? - Ivan V. On Feb 15, 10:47 pm, "Michael Koziarski" <mich...@koziarski.com> wrote:> > 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'', > :edit=>''modifier} > > -- > Cheers > > Koz--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---