0

I want to add the user's avatar next to the name in options:

<%= f.select(:user_id, 
    @users.map{|s|[s.lastname+', '+s.firstname, s.id]}, 
    {}, 
    :class => "ui fluid dropdown"
    ) %>

And If possible, I want also to enter some html in it:

<%= @user.avatar.blank? ? 
    image_tag("no-image.png", alt: "noimage", class: "ui small rounded image") :
    image_tag(@user.avatar.url(:thumb), alt: "user-image", class: "ui small rounded image") 
    %>

How is it possible in Rails 4?

EDIT: Another thing I want to do is to display a circle with a color on the front of the text. Let's say I want a green dot in front of active users and a red on inactive ones. This is going to be implemented with CSS and I've seen it a lot of times in various websites, but I am not sure how to do it.

Radolino
  • 1,834
  • 4
  • 26
  • 48
  • It's not possible in `HTML`. – emerson.marini Dec 02 '14 at 15:09
  • possible duplicate of [putting images with options in a dropdown list](http://stackoverflow.com/questions/4941004/putting-images-with-options-in-a-dropdown-list) – Pete Dec 02 '14 at 15:29
  • This is not what I want, messing around with hacks in javascript to just show something. I want to implement this inside rails. The "duplicate" has nothing to do with it. – Radolino Dec 02 '14 at 16:21

0 Answers0