Skip to content
Discussion options

You must be logged in to vote

Thanks!

I actually think I've gotten it to work as-is with https://api.rubyonrails.org/classes/ActionController/Renderer.html

At least in my simple tests. I don't know if it is helpful if I mention that on #1106. Rails 6.1.

ApplicationController.render(MyViewComponent.new)

Actually seems to work. There is a problem involved if you have devise in your app -- which I think is unrelated to ViewComponent, and is a problem trying to use AppliationController.render at all with anything that might access current_user . I think it's all a devise/warden issue, that they don't play well with it.

Here's the beginning of a kind of horrifying workaround to that...

ApplicationController.renderer.
  new("…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jrochkind
Comment options

Answer selected by joelhawksley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants