0
如何在强参数中添加参数?如何在强参数中添加参数?
当对象被实例化时,我可以选择“类型”。 但我无法更新此“类型”。
我可以用参数做两种方法吗?例如: :
def custom_field_params
params.require(:custom_field).permit(:name, :required, :type_id, options_attributes: [:id, :name, :position, :_destroy])
end
def update_custom_field_params
params.require(:custom_field).permit(:name, :required, options_attributes: [:id, :name, :position, :_destroy])
end
我可以将这两种方法合并为一种方法吗?