# In search result drop box: add given name next to username

**URL:** <https://meta.discourse.org/t/in-search-result-drop-box-add-given-name-next-to-username/48735>\
**Category:** UX\
**Created:** [2016 年 8 月 17 日午後 1:07 UTC](https://meta.discourse.org/t/in-search-result-drop-box-add-given-name-next-to-username/48735 "2016-08-17T13:07:25Z")\
**Posts on this page:** 1\
**Showing post:** 29

<div class="post-metadata">

**Author:** ![designbygio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/designbygio/32/122415_2.png) [@designbygio](https://meta.discourse.org/u/designbygio)\
**Post date:** [2017 年 2 月 22 日午前 11:34 UTC](https://meta.discourse.org/t/in-search-result-drop-box-add-given-name-next-to-username/48735/29 "2017-02-22T11:34:50Z")

</div>

Thank you @fantasticfears  
I was able to create a new Serializer specific for search and use it in place of `BasicUserSerializer` and look like is working.. in all the pages.

This is how my `SearchResultUserSerializer` look like:

```plaintext
class SearchResultUserSerializer < ApplicationSerializer
  attributes :id, :username, :avatar_template, :name

  def avatar_template
    if Hash === object
      User.avatar_template(user[:username], user[:uploaded_avatar_id])
    else
      user.try(:avatar_template)
    end
  end

  def user
    object[:user] || object
  end

end

```

Does it make sense? (again, no experience with Ruby/RoR so not sure if is ok to simply get rid of `include_name?` method)

If the serializer is good, the style now look like this:

 ![](https://global.discourse-cdn.com/meta/original/3X/d/9/d9eb0a9f468f831136c91bb54e0ea909ec8ecc9c.png)

---

_[View the full topic](https://meta.discourse.org/t/in-search-result-drop-box-add-given-name-next-to-username/48735)._
