Skip to content

Commit f73e1be

Browse files
author
David Heinemeier Hansson
committed
Use modern string-of-arrays syntax
1 parent 07d31ca commit f73e1be

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/generators/rails/templates/api_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<% end -%>
55
<% module_namespacing do -%>
66
class <%= controller_class_name %>Controller < ApplicationController
7-
before_action :set_<%= singular_table_name %>, only: [:show, :update, :destroy]
7+
before_action :set_<%= singular_table_name %>, only: %w[ show update destroy ]
88
99
# GET <%= route_url %>
1010
# GET <%= route_url %>.json

lib/generators/rails/templates/controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<% end -%>
55
<% module_namespacing do -%>
66
class <%= controller_class_name %>Controller < ApplicationController
7-
before_action :set_<%= singular_table_name %>, only: [:show, :edit, :update, :destroy]
7+
before_action :set_<%= singular_table_name %>, only: %w[ show edit update destroy ]
88
99
# GET <%= route_url %>
1010
# GET <%= route_url %>.json

0 commit comments

Comments
 (0)