Rails フォームで値がblankなら保存しない
class Author < ActiveRecord::Base has_many :book accepts_nested_attributes_for :books, :reject_if => lambda { |a| a[:content].blank? } end
class Author < ActiveRecord::Base has_many :book accepts_nested_attributes_for :books, :reject_if => lambda { |a| a[:content].blank? } end