Question

I want to change view paths for render call (partial):

vp1 = ActionView::PathSet.new
vp1.prefixes << 'bla1'
render partial: 'abc', view_paths: vp1

vp2 = ActionView::PathSet.new
vp2.prefixes << 'bla2'
render partial: 'abc', view_paths: vp2

Such as prepend_view_paths but for ONE render. How can I do it?

Was it helpful?

Solution

You probably could add specific paths before render and delete after.

self._view_paths.paths << "/home/someone/..."
render(partial: ...)

# after filter
self._view_paths.paths.delete("/home/someone/")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top