I have some controllers with member/collection actions. I want to change the name of those actions on the routes, so I can translate the action "/search" to German, for example. How can I do it? I will appreciate any help. -- Posted via http://www.ruby-forum.com/.
Currently I am using Rails 2.2.2 and I shoul not change it. -- Posted via http://www.ruby-forum.com/.
map.resource :search, :controller => "search_controller" map.suche "suche", :controller => "search_controller", :action => "new" Is that what you''re looking for? Gavin http://handyrailstips.com On Jul 30, 2:23 pm, John Smith <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I have some controllers with member/collection actions. I want to change > the name of those actions on the routes, so I can translate the action > "/search" to German, for example. How can I do it? I will appreciate any > help. > -- > Posted viahttp://www.ruby-forum.com/.
Gavin Morrice wrote:> map.resource :search, :controller => "search_controller" > > map.suche "suche", :controller => "search_controller", :action => > "new" > > Is that what you''re looking for? > > Gavin > > http://handyrailstips.com > > On Jul 30, 2:23�pm, John Smith <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>Thanks, what I want is to get the same url when I wrtie: http://localhost:3000/articles/search and http://localhost:3000/articles/suchen -- Posted via http://www.ruby-forum.com/.
I would like to cotinue using REST search_articles_path -- Posted via http://www.ruby-forum.com/.
Sorry - there was a typo in my first example: :controller => "search" - not :controller => "search_controller" using map.search "search", :controller => "search", :action => "new" map.suche "suche", :controller => "search", :action => "new" should mean that both /suchen and /search route to the new search action I think you may have to explicitly state the relative path in your links though, like: <%= link_to "suchen", "/suchen" %> and <%= link_to "search", "/search" %> or if you''re using locales: <%= link_to t(''search.name''), "/#{t ''search.name''}" %> hope that helps? Gavin http://handyrailstips.com On Jul 30, 2:53 pm, John Smith <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I would like to cotinue using REST search_articles_path > -- > Posted viahttp://www.ruby-forum.com/.
Gavin Morrice wrote:> Sorry - there was a typo in my first example: > :controller => "search" - not :controller => "search_controller" > > > using > map.search "search", :controller => "search", :action => "new" > map.suche "suche", :controller => "search", :action => "new" > > should mean that both /suchen and /search route to the new search > action > > I think you may have to explicitly state the relative path in your > links though, > like: > <%= link_to "suchen", "/suchen" %> > and > <%= link_to "search", "/search" %> > > or if you''re using locales: > <%= link_to t(''search.name''), "/#{t ''search.name''}" %> > > hope that helps? > > Gavin > > http://handyrailstips.com > > > > On Jul 30, 2:53�pm, John Smith <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>Thanks for the help, I was looking for something like :as, used to change controller_name on routes, but for collection and member actions. Any ideas? -- Posted via http://www.ruby-forum.com/.