Render partial yields "dynamic constant assignment"

I'm getting a syntax error when rendering a partial. This is a simple
html partial with one instance variable inside it. Rendering as a
"template" instead of as a partial works just fine. The error occurs 3
lines after the last line of HTML code in the partial. There is no line
72! Here is the error:

SyntaxError in Building_blocks#preview
Showing building_blocks/_BB02.html.erb where line #72 raised:

compile error
dynamic constant assignment
BB02 = local_assigns[:BB02]
dynamic constant assignment
BB02_counter = local_assigns[:BB02_counter]

Extracted source (around line #72):
69: </html>

Application Trace:
app/views/building_blocks/_BB02.html.erb:72:in `compile_template'
app/controllers/building_blocks_controller.rb:99:in `preview'
-e:2:in `load'

Don't start your partial names with a capital letter. rails creates a local variable for the object corresponding to the partial and local variables can't start with a capital letter


Frederick Cheung wrote: