Rails is it possible? -
is possible exec ruby code in instance variable in controller?
example:
def @code = "redirect_to 'https://www.google.com/'" exec(@code) // , redirect. end
don't this. rails ruby. in ruby, can execute command inside string using eval method. , when start getting it, there class_eval.
@myvar = "puts 'should not have done this!!'" eval(@myvar) # should not have done this!! keep safe.
Comments
Post a Comment