From 063c393bf0a2eb762770c97f925b7c2867361ad4 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Sat, 12 Apr 2008 12:40:40 +1200 Subject: Allow alternative values for the 'new' and 'edit' actions in resourceful routes. map.resource :schools, :as => 'escuelas', :path_names => { :new => 'nueva' } Closes #11181. [ivanvr] --- actionpack/test/controller/resources_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index c62a2043d9..0f1ac30f04 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -76,6 +76,12 @@ class ResourcesTest < Test::Unit::TestCase end end + def test_override_paths_for_default_restful_actions + resource = ActionController::Resources::Resource.new(:messages, + :path_names => {:new => 'nuevo', :edit => 'editar'}) + assert_equal resource.new_path, "#{resource.path}/nuevo" + end + def test_multiple_default_restful_routes with_restful_routing :messages, :comments do assert_simply_restful_for :messages -- cgit v1.2.3