diff --git a/lib/lucky_sneaks/proxy_attributes_form_helpers.rb b/lib/lucky_sneaks/proxy_attributes_form_helpers.rb index a83df8b..5f9bfc9 100644 --- a/lib/lucky_sneaks/proxy_attributes_form_helpers.rb +++ b/lib/lucky_sneaks/proxy_attributes_form_helpers.rb @@ -26,7 +26,7 @@ module ProxyAttributesFormHelpers # PS: If you have a better/shorter name for this, I'm all ears. :) def proxy_attributes_check_box_tag(form_object_name, proxy_name, object_to_check, local_variable = false) method_name = "#{form_object_name}[#{proxy_name}][]" - parent = local_variable ? eval(form_object_name) : instance_variable_get("@#{form_object_name}") + parent = local_variable ? eval(form_object_name.to_s) : instance_variable_get("@#{form_object_name}") checked_value = parent.send(proxy_name).include?(object_to_check.id) tag = check_box_tag method_name, object_to_check.id, checked_value if previous_check_box_exists_for[method_name]