# ... end # after @event_cancellation_form = EventCancellationMessageForm.new(cancellation_message_params) # パラメータチェックが複数あってもFormModel内で処理できる if @event_cancellation_form.valid? # ... end
|f| = f.fields_for :schedules do |s| # ... =f.submit "一括登録" # form_model class BulkScheduleForm includes Activemodel::Model attr_accessor: schedules # ... def schedule_attributes=(attributes) self.schedules = attributes.map do |schedule_attributes| schedule.new(schedule_attributes) end end end