app/controllers/criteria_controller.rb
# Convert user-provided parameter "name" into true/false.
# This is untrusted input, be cautious with it.
Convert user-provided parameter "name" into true/false.
This is untrusted input, be cautious with it.
Convert user - provided parameter " name " into true / false . This is untrusted input be cautious with it .
def boolean_param(name, default_value = true)
    if params.key?(name)
      user_value = params[name]
      user_value.casecmp?('true') || user_value == '1'
    else
      default_value
    end
  end
def boolean_param ( name , default_value = true ) if params . key? ( name ) user_value = params [ name ] user_value . casecmp? ( 'true' ) || user_value == '1' else default_value end end
Convert user-provided parameter "name" into true/false.
Convert user - provided parameter " name " into true / false .
name
<not_specific>
default_value
<not_specific>