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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 09 June 2008 04:21:42 [email protected] 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? :slight_smile:

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-----