Paul Mateescu
2005-Jul-23 20:07 UTC
observe_field issue with ''&'' and other characters typed in
Hello,
I am trying to use an observe_field for a live search.
In the .rhtml file I am using:
<%= text_field_tag :searchtext %>
<%= observe_field(:searchtext, :frequency => 0.1, :update =>
:continut, :url => { :action => :live_search },
:with => "''search='' + escape(value)") %>
Everything works out fine with the following exceptions:
- when I type a ''&'' in the search box, everything that
follows after it
is ignored. That is, when I type ''Chip&Dale'' in the search
box, only
''Chip'' gets to :live_search.
- when I type a ''\'' in the search box, :live_search gets
''\\''.
Any ideas how I can solve this? I saw that rubyonrails.com implements
the search correctly (the &''s and \''s get through OK), so
there must be
a work-around.
Best regards,
Paul