M
Mark Mr
Ok so I got the text field to populate a list of what I needed but I
have a problem. When I select an item in Firefox, there's 4 spaces that
appear before it in the text field. In safari, nothing appears in the
field after selecting. I saw reference to this problem while searching
online but couldnt quite find a solution. My code is almost exactly
whats in the scriptaculous example at
http://demo.script.aculo.us/ajax/autocompleter_customized
here it is:
#controller
def auto_complete_for_software_title
auto_complete_responder_for_software params[:software][:title]
end
private
def auto_complete_responder_for_software(value)
@soft = Software.find
all,
:conditions => [ 'LOWER(title) LIKE ?',
value.downcase + '%' ],
rder => 'title ASC',
:limit => 40)
render
artial => 'software_list'
#view
<%= text_field_with_auto_complete :software, :title, {}, :skip_style =>
true %>
#partial
<ul>
<% for soft in @soft do -%>
<li>
<%=h soft.title %>
</li>
<% end -%>
</ul>
I tried alot of different things but nothing seems to be fixing it. Any
help would be greatly appreciated. I'm almost there
have a problem. When I select an item in Firefox, there's 4 spaces that
appear before it in the text field. In safari, nothing appears in the
field after selecting. I saw reference to this problem while searching
online but couldnt quite find a solution. My code is almost exactly
whats in the scriptaculous example at
http://demo.script.aculo.us/ajax/autocompleter_customized
here it is:
#controller
def auto_complete_for_software_title
auto_complete_responder_for_software params[:software][:title]
end
private
def auto_complete_responder_for_software(value)
@soft = Software.find
:conditions => [ 'LOWER(title) LIKE ?',
value.downcase + '%' ],
:limit => 40)
render
#view
<%= text_field_with_auto_complete :software, :title, {}, :skip_style =>
true %>
#partial
<ul>
<% for soft in @soft do -%>
<li>
<%=h soft.title %>
</li>
<% end -%>
</ul>
I tried alot of different things but nothing seems to be fixing it. Any
help would be greatly appreciated. I'm almost there