app/controllers/publish/courses/applications_open_controller.rb
# This is needed to handle the fact that dates are optionally specified as year/month/day in the UI
# This method assigns the params to the correct YYYY-MM-DD value given what is selected
This is needed to handle the fact that dates are optionally specified as year/month/day in the UI
This method assigns the params to the correct YYYY-MM-DD value given what is selected
This is needed to handle the fact that dates are optionally specified as year / month / day in the UI This method assigns the params to the correct YYYY - MM - DD value given what is selected
def build_course_params
        if params.key?(:course)
          applications_open_from =
            if actual_params["applications_open_from"] == "other"
              "#{actual_params['year']}-#{actual_params['month']}-#{actual_params['day']}"
            else
              actual_params["applications_open_from"]
            end
          params["course"]["applications_open_from"] = applications_open_from
        else
          ActionController::Parameters.new({}).permit
        end
      end
def build_course_params if params . key? ( :course ) applications_open_from = if actual_params [ "applications_open_from" ] == "other" "#{actual_params['year']}-#{actual_params['month']}-#{actual_params['day']}" else actual_params [ "applications_open_from" ] end params [ "course" ] [ "applications_open_from" ] = applications_open_from else ActionController :: Parameters . new ( { } ) . permit end end
This is needed to handle the fact that dates are optionally specified as year/month/day in the UI
This method assigns the params to the correct YYYY-MM-DD value given what is selected
This is needed to handle the fact that dates are optionally specified as year / month / day in the UI This method assigns the params to the correct YYYY - MM - DD value given what is selected