문제

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?

도움이 되었습니까?

해결책

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/")
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top