这张照片有什么问题?
型号:
validates_acceptance_of :terms_of_service, :on => :create, :accept => true, :allow_nil => false
accessor :terms_of_service查看:
<%= check_box :organisation,'terms_of_service', {:style => "margin-left:0px"}, 1, 0 %>在数据库中,我有organisations.terms_of_service。
每次我收到“必须接受服务条款”
如果我使用
<%= check_box :organisation,'terms_of_service', {:style => "margin-left:0px"}, true, false %>验证仍然失败。
如果我关闭了:accept postgres true,它似乎通过了验证,但当我查看=>时,它显示为false。Rails不是应该转换这些东西吗?
为什么我不能说:
型号:
validates_acceptance_of :terms_of_service, :accept => true查看:
check_box blah, blah, options, true在我的数据库里看到一个真的?
你知道怎么回事吗?
相关信息: DB是Postgres,正在运行Rails 2.1
发布于 2010-04-15 20:01:57
删除TOS属性的accessor声明。
发布于 2010-04-15 12:45:23
试一试
<%= check_box :organisation,'terms_of_service', {:style => "margin-left:0px"}, '1', '0' %>https://stackoverflow.com/questions/2642644
复制相似问题