File tree Expand file tree Collapse file tree 3 files changed +19
-13
lines changed
lib/action_dispatch/routing
railties/test/application Expand file tree Collapse file tree 3 files changed +19
-13
lines changed Original file line number Diff line number Diff line change 1- * Fixes multiple calls to ` logger.fatal ` instead of a single call,
2- for every line in an exception backtrace, when printing trace
1+ * Fixes incorrect output from rails routes when using singular resources.
2+
3+ Fixes #26606 .
4+
5+ * Erick Reyna*
6+
7+ * Fixes multiple calls to ` logger.fatal ` instead of a single call,
8+ for every line in an exception backtrace, when printing trace
39 from ` DebugExceptions ` middleware.
4-
5- Fixes #26134
10+
11+ Fixes #26134 .
612
713 * Vipul A M*
8-
14+
915* Add support for arbitrary hashes in strong parameters:
1016
1117 ``` ruby
Original file line number Diff line number Diff line change @@ -1244,11 +1244,11 @@ def resources_path_names(options)
12441244 # the plural):
12451245 #
12461246 # GET /profile/new
1247- # POST /profile
12481247 # GET /profile
12491248 # GET /profile/edit
12501249 # PATCH/PUT /profile
12511250 # DELETE /profile
1251+ # POST /profile
12521252 #
12531253 # === Options
12541254 # Takes same options as +resources+.
@@ -1266,15 +1266,15 @@ def resource(*resources, &block)
12661266
12671267 concerns ( options [ :concerns ] ) if options [ :concerns ]
12681268
1269- collection do
1270- post :create
1271- end if parent_resource . actions . include? ( :create )
1272-
12731269 new do
12741270 get :new
12751271 end if parent_resource . actions . include? ( :new )
12761272
12771273 set_member_mappings_for_resource
1274+
1275+ collection do
1276+ post :create
1277+ end if parent_resource . actions . include? ( :create )
12781278 end
12791279 end
12801280
Original file line number Diff line number Diff line change @@ -159,13 +159,13 @@ def test_rails_routes_with_namespaced_controller_environment
159159 end
160160 RUBY
161161 expected_output = [ " Prefix Verb URI Pattern Controller#Action" ,
162- " admin_post POST /admin/post(.:format) admin/posts#create" ,
163162 " new_admin_post GET /admin/post/new(.:format) admin/posts#new" ,
164163 "edit_admin_post GET /admin/post/edit(.:format) admin/posts#edit" ,
165- " GET /admin/post(.:format) admin/posts#show" ,
164+ " admin_post GET /admin/post(.:format) admin/posts#show" ,
166165 " PATCH /admin/post(.:format) admin/posts#update" ,
167166 " PUT /admin/post(.:format) admin/posts#update" ,
168- " DELETE /admin/post(.:format) admin/posts#destroy\n " ] . join ( "\n " )
167+ " DELETE /admin/post(.:format) admin/posts#destroy" ,
168+ " POST /admin/post(.:format) admin/posts#create\n " ] . join ( "\n " )
169169
170170 output = Dir . chdir ( app_path ) { `bin/rails routes -c Admin::PostController` }
171171 assert_equal expected_output , output
You can’t perform that action at this time.
0 commit comments