app/controllers/travel_requests_controller.rb
def clean_params
      return unless params[:travel_request].present?
      params[:travel_request][:event_requests] = [params[:travel_request][:event_requests_attributes]["0"]] if params[:travel_request][:event_requests_attributes].present?

      parse_date(params[:travel_request][:event_requests][0], :event_dates) if params[:travel_request][:event_requests].present?
      parse_date(params[:travel_request], :travel_dates)
    end
# TODO: remove this when the form gets done correctly
remove this when the form gets done correctly
remove this when the form gets done correctly
def clean_params
      return unless params[:travel_request].present?
      params[:travel_request][:event_requests] = [params[:travel_request][:event_requests_attributes]["0"]] if params[:travel_request][:event_requests_attributes].present?
      parse_date(params[:travel_request][:event_requests][0], :event_dates) if params[:travel_request][:event_requests].present?
      parse_date(params[:travel_request], :travel_dates)
    end
def clean_params return unless params [ :travel_request ] . present? params [ :travel_request ] [ :event_requests ] = [ params [ :travel_request ] [ :event_requests_attributes ] [ "0" ] ] if params [ :travel_request ] [ :event_requests_attributes ] . present? parse_date ( params [ :travel_request ] [ :event_requests ] [ 0 ] , :event_dates ) if params [ :travel_request ] [ :event_requests ] . present? parse_date ( params [ :travel_request ] , :travel_dates ) end
TODO: remove this when the form gets done correctly
TODO : remove this when the form gets done correctly