根据我尝试的Rails Guide:
validates :terms_of_service, acceptance: true, message: 'Please accept that the application is complete.'
但是它导致了MessageValidator错误。然后我尝试this from SO,但这是为了早期的Rails,并没有显示我的消息。它始终只显示默认消息。
答案 0 :(得分:0)
这很有用。
validates :terms_of_service, acceptance: { accept: '1', message: 'Please accept that the application is complete.' }