나는 큰지고있어 상관없이 다른 모든이 형태의 검증하지만, 인라인 오류 메시지를 내가 시도해보십시오, 나는이 체크 박스에 대한 제출을 명중 한 후에 어떤 메시지도 나타나지 않는 것 같습니다. 양식을 확인하기 전까지 양식이 제출되지 않으므로 유효성 검사가 작동하지만 사용자에 대한 피드백을보고 싶습니다.: assocation를 통해 레일 3 AJAX 형태로, client_side_validations 보석으로
내 모델 (벗었) : 내보기에
class Resource < ActiveRecord::Base
attr_accessible :objective_ids
has_many :obsources, :dependent => :destroy
has_many :objectives, :through => :obsources
validates_presence_of :objective_ids, :message => "Must check at least one"
end
class Objective < ActiveRecord::Base
has_many :obsources, :dependent => :destroy
has_many :resources, :through => :obsources
end
양식은 (벗었) :
이 이<%= simple_form_for @resource, remote: true, :validate => true, :html => { :id => "resource-form#{@resource.skill_id}" } do |f| %>
<%= f.hidden_field :skill_id, :value => @resource.skill_id %>
<%= f.association :objectives, :label => "Objectives Targeted (at least 1)", :collection => Skill.find("#{@resource.skill_id}").objectives, :as => :check_boxes, :label_method => lambda { |objective| "#{objective.content}" } %>
<%= f.submit %>
<% end %>
이 이
생각이 많이 주시면 감사하겠습니다!