0

select tag:-

<%=select_tag "names",options_from_collection_for_select(@users,"id","name",@user.id)%>

Right now my dropdown looks like this:-

john
matt
sara

But I want to have it like:-

 john edit
 matt edit
 sara  edit

Where "edit" is the link which can edit a particular user.But I am not able to put a link into select_tag.

Thanks

Apurva Mayank
  • 721
  • 2
  • 12
  • 32

1 Answers1

3

There's no way to do this in Rails out of the box - this is rather uncommon task. Yet I see two options here:

  1. use solutions like this;
  2. find yourself a suitable jQuery plugin like this. Most of them will turn the select tag into divs, which can be further customized.
Community
  • 1
  • 1
oldhomemovie
  • 14,621
  • 13
  • 64
  • 99