First thank you for your quick response.  This forum seems like a place 
I will be able to learn some proper rails coding.

> NO!  NO!  NO!  NEVER USE GLOBAL VARIABLES FOR THIS SORT OF THING!

I have never programmed in ruby and have inherited this application to 
only make a few small changes.  Unfortunately the original programmer 
used 50+ global variables and I really do not want to rewrite 
everything.

> OK, now that I've got your attention :) , please explain what you're
> trying to do with $gItems.  There will be a more appropriate place to
> put it than in a global variable; we just have to figure out what it is.

this app has a parameter file where the number of items can be changed. 
Depending on the integer that is placed in the parameter file, the view 
must create a table element with the appropriate number of columns 
($gItems).  $gItems is created in ApplicationController class the first 
time someone navigates to the Auctioneer view from the 
auctioneer_controller class index method.  This allows each subsequent 
client screen to draw a table showing the appropriate number of items. 
I feel like my explanation is very convoluted, as is the code.  let me 
know if i should break it down further.

One thing to note might be that this app is not database backed.  This 
is probably why the original programmer constantly used globals.

> Note, however, that Haml is generally a superior alternative to ERb, and
> in this case it provides an easier way to do this with its %tag[object]
> syntax.

thanks, I like the look of Haml and will look into it further.

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to