app/controllers/data_fields_controller.rb
def check_for_data_type
    unless params[:data_type_id]
      flash[:error] = "You must specify a data type before viewing associated
                      data fields."
      redirect_to data_types_path
    end
  end
# Intercept and redirect if no data type id provided
Intercept and redirect if no data type id provided
Intercept and redirect if no data type id provided
def check_for_data_type
    unless params[:data_type_id]
      flash[:error] = "You must specify a data type before viewing associated
                      data fields."
      redirect_to data_types_path
    end
  end
def check_for_data_type unless params [ :data_type_id ] flash [ :error ] = "You must specify a data type before viewing associated
                      data fields." redirect_to data_types_path end end
Intercept and redirect if no data type id provided
Intercept and redirect if no data type id provided