Replies: 1 comment 1 reply
-
There is an open issue #1106 where we have been discussing this. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there any way to render a ViewComponent from outside a controller action?
Say, from a background job? )
i guess you could use
component.render_in(view_context)
. Now the problem becomes... where do you get/how do you make aview_context
yourself when you don't have one? But also, I'm not sure how you'd actually get the results, so that's not the only problem.Oh wait, there's also this weird little-known part of Rails... not sure how/if it can apply to ViewComponents. https://api.rubyonrails.org/classes/ActionController/Renderer.html
Has anyone figured out a reasonable way to do this?
Beta Was this translation helpful? Give feedback.
All reactions