OSDN Git Service

[BUGFIX] User suggest at team_members/new not working with relative_url_root
authorChristian Simon <cs@f03.eu>
Wed, 24 Apr 2013 07:31:36 +0000 (09:31 +0200)
committerChristian Simon <cs@f03.eu>
Wed, 24 Apr 2013 17:40:09 +0000 (19:40 +0200)
* Closing #3540
* Closing #3704

app/assets/javascripts/api.js.coffee
app/controllers/application_controller.rb

index ca72151..7cac971 100644 (file)
@@ -50,4 +50,5 @@
       callback(users)
 
   buildUrl: (url) ->
+    url = gon.relative_url_root + url if gon.relative_url_root.present?
     return url.replace(':version', gon.api_version)
index 32b1246..22fe5ab 100644 (file)
@@ -155,5 +155,6 @@ class ApplicationController < ActionController::Base
     gon.api_version = Gitlab::API.version
     gon.api_token = current_user.private_token if current_user
     gon.gravatar_url = request.ssl? ? Gitlab.config.gravatar.ssl_url : Gitlab.config.gravatar.plain_url
+    gon.relative_url_root = Gitlab.config.gitlab.relative_url_root
   end
 end