Hi all,
i was using auto complete feature in my rails app, when i used to type a
character it responds very well and displays all the items match with
that character.
and now the thing is when i try to select any item from the list using
my keyboard down (or) up arrrow, its not working in IE 7 and forced to
use mouse at this point, but works pretty good in FF and also works fine
when selected with mouse
and my code is :
Code : ruby - fold - unfold
-
<%= my_text_field_with_auto_complete :article, :title,
{:index => ha.id, :class => “text”, :value => ha.article_title},
{:skip_style => true} %>
3.
4.
5.
6. #partial for list:
7.- <%= article.title %>
8. <% @articles.each do |article| %>
9.
10. <% end %>
11.
12.
13.
14. #controller:
15. def auto_complete_for_article_title
16. article_index = params[:article].keys[0] # get index as its
always only one at a time
17.
auto_complete_responder_for_article_title(params[:article][article_index][:title])
18. end
19.
20. def auto_complete_responder_for_article_title(value)
21. @articles = Article.find_by_sql(“select title from articles
where title like ‘%#{value}%’”)
22. render :partial =>
‘/resources/homepages/article_auto_complete_list’, :layout => false
23. endany suggestions !!
thanks in advance .