hello rubys,
i got a problem with the text_field_with_auto_complete().
everthing''s working but unfortunately the items (which are for
choosing)
are filled into the input=text in a way that is unacceptable.
the first 6 characzers are empty-spaces, than the item and at last 5
empty-spaces.
doeas anybody know why? and maybe how to solve this problem?
my code is following:
view:
<td><%= text_field_with_auto_complete(:vorgang, :bez, {:class =>
''auto_complete_schmal''}, {:skip_style => true} )
%></td>
controller:
def auto_complete_for_vorgang_bez()
search = params[:vorgang][:bez].downcase # content of the text-field
search = ''%'' + search + ''%'' # format
string for request
conditions = [''(LOWER(bez) LIKE ?)'', search] # sql
@vorgaenge = Vorgang.find(:all, :conditions => conditions, :limit =>
1) # request
render(:partial => ''vorgang_filter_select'') # rendering
in
_form_test.rhtml
end
please give me an hint. i''m thankful for every helping answer.
bless
chris
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
hi, I also faced the problem of appended whitespaces, I did a fix in controls.js of scriptaculous by writting this.element.value = (value.replace(/^\W+/,'''')).replace(/\W+$/,''''); you will find this around line 250..260 hope this helps regards gaurav --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i solved it by myself. this link is very helpful: http://wiki.rubyonrails.org/rails/pages/How+to+use+text_field_with_auto_complete/versions/73 the answer which belongs to the sixth question is the key. bless chris -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---