I have a rather large table that has several fields with null values for later use. However, as the project matures, more fields may be used. I am using RoR to gather data, and do a visual check on data moved from some legacy applications, to see if they are correct. So therefore, I sort of want to have columns from different tables next to each other for comparison. However, I want to make this easy on the eye, and if the column on one side has a nil, I don''t want to display it. I know I can go thru my model and select the fields to display, but wonder how rails could cope with these nil values? I have tried to use some suggestions found in the group such as: xxx.find (params[:id], :select => ''title'',''first'' and so forth, so no avail. Any suggestions? Thanks, Mike Buckley -- ------------------------------ [img]http://www.mjbuckley.org/gmail-2.png[/img] _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Oct 1, 2005, at 7:44 PM, Mike Buckley - wrote:> I have a rather large table that has several fields with null > values for later use. However, as the project matures, more fields > may be used.ALTER TABLE ADD ... is not acceptable? Check out Migrations for just this scenario.> I am using RoR to gather data, and do a visual check on data moved > from some legacy applications, to see if they are correct. So > therefore, I sort of want to have columns from different tables > next to each other for comparison. However, I want to make this > easy on the eye, and if the column on one side has a nil, I don''t > want to display it.Then omit them from your view.> Any suggestions?Simply ignore the nil attributes. Better: don''t include them in your table. Use a Migration to add them as needed. Regards, jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (Darwin) iD8DBQFDP1cGAQHALep9HFYRArTqAJ9f9ccV4QTGLZRb5AoCAuauCRFesQCeMlJu DgN0eO/VbAnfJh5QSWjzlDs=kAcp -----END PGP SIGNATURE-----
Jeremy Kemper <jeremy@...> writes> > > On Oct 1, 2005, at 7:44 PM, Mike Buckley - wrote: > > I have a rather large table that has several fields with null > > values for later use. However, as the project matures, more fields > > may be used. > > ALTER TABLE ADD ... is not acceptable? Check out Migrations for just > this scenario. > > > I am using RoR to gather data, and do a visual check on data moved > > from some legacy applications, to see if they are correct. So > > therefore, I sort of want to have columns from different tables > > next to each other for comparison. However, I want to make this > > easy on the eye, and if the column on one side has a nil, I don''t > > want to display it. > > Then omit them from your view. > > > Any suggestions? > > Simply ignore the nil attributes. > > Better: don''t include them in your table. Use a Migration to add > them as needed. > > Regards, > jeremy >I think I need to give you more detail. What I want is a nice concise table with the column name and value next to it, and an associated table with the other value next to it like this: Table X Value Table Y Value Column_name xxx NewColumn xxx Now if you run into a nil value in Table X, I just want to not report the column. On table y, I will need a similar setup, and mapping for that table... which I think I can figure out, but being able to just use the scaffold setup of "for column in TableX.Column_name etc.... would be great. Thanks for your suggestion, and hopefully more will throw their two cents in... Mike