class <%= plural_model_name %>Controller < ApplicationController before_action :set_<%= instance_name %>, only: [:show, :edit, :update, :destroy] <%= controller_methods %> private def set_<%= instance_name %> @<%= instance_name %> = <%= model_name %>.where(id: params[:id]).first end def <%= instance_name %>_params params.require(:<%= instance_name %>).permit(<%= attributes.map { |a| ":#{a.name}" }.join(", ") %>) end end