Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering with or without VC monkey-patch #30

Closed
Matt-Yorkley opened this issue Apr 9, 2021 · 3 comments
Closed

Rendering with or without VC monkey-patch #30

Matt-Yorkley opened this issue Apr 9, 2021 · 3 comments

Comments

@Matt-Yorkley
Copy link

Hi, I'm playing with view_component_storybook in a Rails 5 app that uses the wicked_pdf gem and hitting the clashing-monkey-patches issue with ViewComponent.

Would it make sense to replace #render here with #render_component to allow Storybook to work correctly regardless of whether the VC monkey patch is enabled or disabled?

https://github.com/jonspalmer/view_component_storybook/blob/baabed807adcb6d51f59f43cbf19db76bdf5a5ee/app/views/view_component/storybook/stories/show.html.erb#L1

Rails 5 compatibility notes here for reference.

@jonspalmer
Copy link
Owner

I'm not sure its quite as simple as that. We'd likely need to detect the monkey patch setting in ViewComponent and do the right thing. Happy to consider a pull request.

@Matt-Yorkley
Copy link
Author

Ah! I thought the #render_component method was available either way, but yeah I see now it's only conditionally included after a Rails version check here.

@jonspalmer
Copy link
Owner

@Matt-Yorkley Can we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants