|
|
@ -37,15 +37,11 @@ class RecordsController < ApplicationController |
|
|
|
# TODO: externalize |
|
|
|
# TODO: externalize |
|
|
|
def modify |
|
|
|
def modify |
|
|
|
@record = Record.where(:authentication_token => params[:authentication_token]).first! |
|
|
|
@record = Record.where(:authentication_token => params[:authentication_token]).first! |
|
|
|
if @record.type != 'A' |
|
|
|
return render(:text => MODIFY_ERROR) if @record.type != 'A' |
|
|
|
return render :text => MODIFY_ERROR |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
@record.content = params[:ip] || client_remote_ip |
|
|
|
@record.content = params[:ip] || client_remote_ip |
|
|
|
@record.save! |
|
|
|
@record.save! |
|
|
|
respond_with(@record) do |format| |
|
|
|
respond_with(@record) do |format| |
|
|
|
format.html { |
|
|
|
format.html {render(:text => MODIFY_OK)} |
|
|
|
render :text => MODIFY_OK |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|