vemon388-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Jun-09 02:21 UTC
Filter Results via Post
Hi guys, I''m trying to filter my record results by submitting a post value via select field with filter results. It works when the results are active, but otherwise it returns a nil object error. Here is my code: http://pastie.org/211299 Thanks, Levi --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 09 June 2008 04:21:42 vemon388-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> I''m trying to filter my record results by submitting a post value via > select field with filter results. It works when the results are > active, but otherwise it returns a nil object error.You call params[:vendor][:id] without checking the value of params[:vendor]. What if params[:vendor] is nil, as is the case when it isn''t passed? :-) You''ll probably find it more natural to work with the passed parameters if you call the form input vendor_id instead of vendor[id]. Ciao, Sheldon. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFITZZLpGJX8XSgas0RAkhXAJ9UxqeYoBDL8E5BU72x7999WvXxHwCcC7N+ vI4fIKqjuUPgCEukxUmaRzo=2+B/ -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---