views:

12

answers:

0

I'm using jquery Ui autocomplete, with this highlight function http://stackoverflow.com/questions/3053286/how-highlight-words-jquery-ui-autocomplete

My problem is that it works. But in the drop-down list the strong tag is not rendered as html but as text. For example when i type Wild I end up with something like this Oscar <strong>Wild</strong>e. But i want this Oscar Wild e My rails controller is

def index
    @authors = Author.where('name LIKE ?', "%#{params[:term]}%").limit(5).all
    respond_to do |format|
      format.html
      format.json {render :json => @authors.map {|a| a.name }}
    end
  end