I think I may have found a bug with the auto_complete feature in rails: My controller has a before_filter with an except clause preventing the filter from running on a specific action. The action renders a view with a text_field_with_auto_complete field. Much to my suprise, the filter appears to run when I type data into this field! The filter is part of my security regime, so I end up with a login page rendered into the bottom right of the browser - where the auto-complete drop down list is normally displayed. This is in Safari. Firefox doesn''t render the login page, but if I inspect the AJAX response using the Firebug plug-in, I can see the login page has been returned. Weird, huh? Lindsay -- Posted via http://www.ruby-forum.com/.
On Wednesday, June 21, 2006, at 12:35 PM, Lindsay Boyd wrote:>I think I may have found a bug with the auto_complete feature in rails: > >My controller has a before_filter with an except clause preventing the >filter from running on a specific action. The action renders a view with >a text_field_with_auto_complete field. Much to my suprise, the filter >appears to run when I type data into this field! The filter is part of >my security regime, so I end up with a login page rendered into the >bottom right of the browser - where the auto-complete drop down list is >normally displayed. This is in Safari. Firefox doesn''t render the login >page, but if I inspect the AJAX response using the Firebug plug-in, I >can see the login page has been returned. > >Weird, huh? > >Lindsay > >-- >Posted via http://www.ruby-forum.com/. >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/railsNot really. The autocompleter just fires off an ajax request every so often, which must normally pass through the standard filter chains. I think if you set your before_filter :except=>[''auto_complete_for_object_attribute''], this problem will go away. _Kevin -- Posted with http://DevLists.com. Sign up and save your mailbox.
> I think if you set your before_filter > :except=>[''auto_complete_for_object_attribute''], this problem will go > away.Ah, I think I see what is happening now! Do you mean literaly ''auto_complete_for_object_attribute''. Or if my action is called ''search'', would I use ''auto_complete_for_search''? Do I also need to add a new action called ''''auto_complete_for_search''? thanks Lindsay -- Posted via http://www.ruby-forum.com/.
Lindsay Boyd wrote:> Ah, I think I see what is happening now!I''ve got it Kevin... my auto complete is on a model, attribute so an example would be :except=>[''auto_complete_for_post_title''] to use our Blog example. Thanks for your help -Lindsay -- Posted via http://www.ruby-forum.com/.