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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -