Rails Engine RouteProxy Appearance and Controller

I am trying to define an auxiliary routing string in a class designed for insecure code evaluation. Basically, I have a SafeEval class that will evaluate a string in an isolated class. I did the following to get route helpers working in SafeEval

include ActionController::UrlFor
include Rails.application.routes.url_helpers

All manual assistants work except route proxy servers. In my views and controllers, I can call blog.page_path (@page), but I cannot call blog.page_path in SafeEval - I don't define a blog. I checked in my presentation and the blog is RouteProxy.

So my question is how can I get the route proxy in the appearance / controller class

(SafeEvla does not make much sandboxing, you can assume a very simple structure: a method that just runs eval (str) at the moment inside the SafeEval class.)

+3
source share

All Articles