i need to create a method, which gets called by a local application with two parameters. how can i return true or false then? with xml? my method looks like this:
def check_license
app_id = params[:id]
app_sn = params[:sn]
@license = License.find_by_id(app_id)
respond_to do |format|
if @license.app_serial == app_sn
# should return true here
else
# should return false here
end
end
end
thanks in advance!
You first need to decide with format your other internal application will call this application. Popular (and sane) formats are xml or json.
Then, in your controller, you need to render a response in each of those formats: