Forum: Ruby on Rails $SAFE ERB

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Alex Y. (Guest)
on 2006-04-06 23:16
(Received via mailing list)
Hi all,

I've got some ERB templates in the database which I want to run in a
$SAFE=2 binding.  I've got it working in the tests, but as soon as I try
to view it through the full stack, I get an "Insecure operation -
class_eval" exception from

Two things:  first, why does it work when the templates are coming in
from fixtures but not from the database, and second, how might I fix
this?  I'd rather not drop the $SAFE level if I can avoid it.

Anyone got any smart ideas?
This topic is locked and can not be replied to.