Skip to content

Commit

Permalink
Use modern string-of-arrays syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Jan 22, 2021
1 parent 07d31ca commit f73e1be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/generators/rails/templates/api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<% end -%>
<% module_namespacing do -%>
class <%= controller_class_name %>Controller < ApplicationController
before_action :set_<%= singular_table_name %>, only: [:show, :update, :destroy]
before_action :set_<%= singular_table_name %>, only: %w[ show update destroy ]
# GET <%= route_url %>
# GET <%= route_url %>.json
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/rails/templates/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<% end -%>
<% module_namespacing do -%>
class <%= controller_class_name %>Controller < ApplicationController
before_action :set_<%= singular_table_name %>, only: [:show, :edit, :update, :destroy]
before_action :set_<%= singular_table_name %>, only: %w[ show edit update destroy ]
# GET <%= route_url %>
# GET <%= route_url %>.json
Expand Down

0 comments on commit f73e1be

Please sign in to comment.