Passing Parameters to erb in Cuba

There is a great deal of help for rails, some for sinatra, and little
for Cuba, NYNY and the like. The answers for Sinatra seem to not apply
exactly to Cuba. I want to pass in a parameter from a ruby environment
to an erb in Cuba. This is a simplified test for passing in, from the
routing environment, what will be an array of objects in the final code.

This simplified sample consists in parametrically defining ‘color’ to be
“red”, but if it not set to anything, then internally it is then set to
green. The target code would need to bail out if the parameter were not
set. As currently set, samp1 successfully renders the erb file, but it
is green. The question resolves into: How must I change samp1 (or any of
the samp-n’s) within app2.rb in order to set ‘color’ within sample.erb
to red? Hopefully, I can abstract the answer to use globally for my
purpose. Note the other samp-n’s are other failed tries.

Very Many Thanks for any help.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs