app/controllers/annotator/annotator_store/annotations_controller.rb
# Convert the data sent by AnnotatorJS to the format that Rails expects so
# that we are able to create a proper params object
Convert the data sent by AnnotatorJS to the format that Rails expects so
that we are able to create a proper params object
Convert the data sent by AnnotatorJS to the format that Rails expects so that we are able to create a proper params object
def format_client_input_to_rails_convention_for_update
    code = get_code(params[:tags].first)
    format_client_input_to_rails_convention_for_create(code)
    params[:annotation][:ranges_attributes] = {}
  end
def format_client_input_to_rails_convention_for_update code = get_code ( params [ :tags ] . first ) format_client_input_to_rails_convention_for_create ( code ) params [ :annotation ] [ :ranges_attributes ] = { } end
Convert the data sent by AnnotatorJS to the format that Rails expects so
that we are able to create a proper params object
Convert the data sent by AnnotatorJS to the format that Rails expects so that we are able to create a proper params object
# Annotator sends duplicate ranges when an annotation is updated which would then be saved. # As ranges are not allowed to be changed we can simply remove the provided attributes.