diff --git a/app/controllers/api/v1/platforms_controller.rb b/app/controllers/api/v1/platforms_controller.rb index b68c0755b..2a2ecec78 100644 --- a/app/controllers/api/v1/platforms_controller.rb +++ b/app/controllers/api/v1/platforms_controller.rb @@ -85,7 +85,15 @@ class Api::V1::PlatformsController < Api::V1::BaseController private def json_response(message, nullify_id = false) - id = nullify_id ? nil : @platform.id + if nullify_id + errors = @platform.errors.full_messages.join('. ') + if errors.present? + message << '. ' << errors + end + id = nil + else + id = @platform.id + end { :platform => {:id => id, :message => message} }.to_json end