Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Neff <benjamin@coding4coffee.ch>2016-09-18 02:48:41 +0300
committerSteffen van Bergerem <svbergerem@omgsrsly.net>2016-09-28 22:59:08 +0300
commit07a4925f3b75b3561c9791ae68d424b3b87fe350 (patch)
treeb724423d20835017537b25eb46f2cad8baf60de8 /app/controllers
parent20cdbe262e7c7bd56989ffc9decc87f63738d6e9 (diff)
Extract tags autocompletion JS to file
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/profiles_controller.rb7
-rw-r--r--app/controllers/users_controller.rb1
2 files changed, 2 insertions, 6 deletions
diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb
index 409dcaee0..bb4d9b070 100644
--- a/app/controllers/profiles_controller.rb
+++ b/app/controllers/profiles_controller.rb
@@ -23,12 +23,7 @@ class ProfilesController < ApplicationController
@aspect = :person_edit
@profile = @person.profile
- @tags = @profile.tags
- @tags_array = []
- @tags.each do |obj|
- @tags_array << { :name => ("#"+obj.name),
- :value => ("#"+obj.name)}
- end
+ gon.preloads[:tagsArray] = @profile.tags.map {|tag| {name: "##{tag.name}", value: "##{tag.name}"} }
end
def update
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 63d8074e1..b13dd822c 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -87,6 +87,7 @@ class UsersController < ApplicationController
@person = @user.person
@profile = @user.profile
gon.preloads[:inviter] = PersonPresenter.new(current_user.invited_by.try(:person), current_user).as_json
+ gon.preloads[:tagsArray] = current_user.followed_tags.map {|tag| {name: "##{tag.name}", value: "##{tag.name}"} }
render "users/getting_started"
end