Radio buttons for boolean field, how to do a “false”?

前端 未结 2 2074
野的像风
野的像风 2020-12-13 10:14

I am currently trying to insert some simple true/false radio buttons in Rails 3, but I can\'t find a way to make a radio button insert \"false\".

My code is the foll

2条回答
  •  执念已碎
    2020-12-13 10:48

    I recently came to another solution for this:

    validates_presence_of :accident_free, :if => 'accident_free.nil?'
    

    Explanation here

提交回复
热议问题