Hello i got a field to search a name in the DB The problem is that the name could have char like # so in my view: <%= text_field_with_auto_complete :member, :name%> <%= observe_field ''member_name'', :frequency => 0.5, :update => ''member_named'', :url => {:controller=>"admin/members",:action=>''live_search''}, :with=> ''member_name''%> so if i put on the textfield "peter #2" i got <%=params[member_name]%> peter so everything after ''#'' isn''t there, what could i do? but in the auto_complete all the names appear while i am writing... -- 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 -~----------~----~----~----~------~----~------~--~---
On Jun 24, 2008, at 11:15 AM, Edgar Gonzalez wrote:> Hello i got a field to search a name in the DB > > The problem is that the name could have char like # > > so in my view: > > <%= text_field_with_auto_complete :member, :name%> > <%= observe_field ''member_name'', > :frequency => 0.5, > :update => ''member_named'', > :url => > {:controller=>"admin/members",:action=>''live_search''}, > :with=> ''member_name''%> > so if i put on the textfield "peter #2" > i got <%=params[member_name]%> peter > > so everything after ''#'' isn''t there, what could i do?Might be something unique to the Ajax code, or perhaps some filtering you''ve forgotten you added. Searching with a plain HTML form, using # and other symbol chars is not a problem, params includes those characters, etc. -- gw --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Jun 24, 7:15 pm, Edgar Gonzalez <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hello i got a field to search a name in the DB > > The problem is that the name could have char like # >You need to use encodeURIComponent Fred> so in my view: > > <%= text_field_with_auto_complete :member, :name%> > <%= observe_field ''member_name'', > :frequency => 0.5, > :update => ''member_named'', > :url => > {:controller=>"admin/members",:action=>''live_search''}, > :with=> ''member_name''%> > so if i put on the textfield "peter #2" > i got <%=params[member_name]%> peter > > so everything after ''#'' isn''t there, what could i do? > > but in the auto_complete all the names appear while i am writing... > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On Jun 24, 7:15�pm, Edgar Gonzalez <rails-mailing-l...@andreas-s.net> > wrote: >> Hello i got a field to search a name in the DB >> >> The problem is that the name could have char like # >> > > You need to use encodeURIComponent > > FredCould you show me an example using encodeURIComponent because the char "#" havent get into the param[:member_name] so i am seeking "Peter #23" the <%=param[:member_name]%> show just "Peter" -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 25 Jun 2008, at 08:45, Frederick Cheung wrote:> > > > On Jun 24, 7:15 pm, Edgar Gonzalez <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> Hello i got a field to search a name in the DB >> >> The problem is that the name could have char like # >> > > You need to use encodeURIComponent > > Fred >> so in my view: >> >> <%= text_field_with_auto_complete :member, :name%> >> <%= observe_field ''member_name'', >> :frequency => 0.5, >> :update => ''member_named'', >> :url => >> {:controller=>"admin/members",:action=>''live_search''}, >> :with=> ''member_name''%>:with => "''member_name='' + encodeURIComponent(value)" Fred>> >> so if i put on the textfield "peter #2" >> i got <%=params[member_name]%> peter >> >> so everything after ''#'' isn''t there, what could i do? >> >> but in the auto_complete all the names appear while i am writing... >> -- >> Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
Hey Fred, thanks man! :P -- 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 -~----------~----~----~----~------~----~------~--~---