On Mon, Jun 22, 2020 at 5:20 PM Craig Russell <apache....@gmail.com> wrote: > > I've pushed a work in progress to branch coi. It currently does what I want > it to do for "get", which is to calculate who is required to affirm the coi. > > But when I submit the "post" it gives an error > #<NameError: undefined local variable or method `coi_current_template_url'> > /srv/whimsy/www/officers/coi.cgi:146:in `emit_post' > /srv/whimsy/www/officers/coi.cgi:130:in `block (5 levels) in <main>' > /srv/whimsy/www/officers/coi.cgi:128:in `block (4 levels) in <main>' > /Users/clr/apache/git/whimsy/lib/whimsy/asf/themes.rb:43:in `block (2 > levels) in _whimsy_panel' > > There is a variable coi_current_template_url but it is out of scope. > > Is there documentation/discussion of scoping rules for the whimsy cgi > environment? > > I've attached the coi.cgi in case it's easier to see what's gone wrong...
Scoping rules in Ruby are a bit complicated. If these values aren't expected to be modified, the recommendation is to change the variable names to be ALL_CAPS. If the values are expected to be modified, prefix the variable name with a dollar sign ($). > Craig L Russell > c...@apache.org - Sam Ruby