lib/generators/rails/templates/api_controller.rb in jbuilder-2.10.1 vs lib/generators/rails/templates/api_controller.rb in jbuilder-2.10.2
- old
+ new
@@ -2,10 +2,10 @@
require_dependency "<%= namespaced_path %>/application_controller"
<% 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
def index
@<%= plural_table_name %> = <%= orm_class.all(class_name) %>