def permitted_params
        if self.respond_to? "#{controller_name.singularize}_params", true
          self.send("#{controller_name.singularize}_params")
        else
          param_key        = _RC.name.split('::').last.singularize.underscore.to_sym
          excluded_fields  = ["id", "created_at", "updated_at"]
          permitted_fields = (_RC.column_names - excluded_fields).map { |f| f.to_sym }
          params.fetch(param_key, {}).permit([]).tap do |wl|
            permitted_fields.each { |f| wl[f] = params[param_key][f] if params[param_key].key?(f) }
          end
        end
      end
def permitted_params
        if self.respond_to? "#{controller_name.singularize}_params", true
          self.send("#{controller_name.singularize}_params")
        else
          param_key        = _RC.name.split('::').last.singularize.underscore.to_sym
          excluded_fields  = ["id", "created_at", "updated_at"]
          permitted_fields = (_RC.column_names - excluded_fields).map { |f| f.to_sym }
          params.fetch(param_key, {}).permit([]).tap do |wl|
            permitted_fields.each { |f| wl[f] = params[param_key][f] if params[param_key].key?(f) }
          end
        end
      end
Only allow a trusted parameter "white list" through.