-1
- @offering.training.each do |train|
= check_box_tag "train_ids[#{train.id}]", train.id
= train.text
class Training < ActiveRecord::Base
attr_accessible :text
belongs_to :offering
validates :text, presence: true
end
你如何驗證在軌3複選框?以下代碼目前不起作用。我會感謝你的幫助人。由於
的【如何簡單地驗證在軌複選框]可能重複(http://stackoverflow.com/questions/16237734/how-to-simply-validate-a-checkbox-in-rails ) – Sculper