Skip to content

Instantly share code, notes, and snippets.

@Unpakt
Unpakt / rails 3.2.11 params patch
Created January 9, 2013 18:54
Put "repair_empty_param_associations" in your before filters in the application_controller.rb
def repair_empty_param_associations
params.keys.each do |key|
repair_nested_params(params, key, params[key])
end
end
private
def repair_nested_params(current_params, key, value)
if key =~ /^(.*)_attributes$/ && value.nil?