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

Coexistence issues with active_scaffold gem #2032

Open
juankiz opened this issue May 23, 2024 · 5 comments
Open

Coexistence issues with active_scaffold gem #2032

juankiz opened this issue May 23, 2024 · 5 comments

Comments

@juankiz
Copy link

juankiz commented May 23, 2024

My best guess is that something similar to either this issue or this issue that is clashing with this file on active_scaffold but since I'm using rails 7.0 I cant use the render_component method.
I would stick to just add the render_component method back directly on my application code, but since it'll be removed in the future, I'm not sure what's the best way to move forward with this.

Steps to reproduce

On a working Rails + ViewComponent app, add the active_scaffold gem.
You can view a minimal example on this repo

Expected behavior

  • Rendering the view component should work as intended.

Actual behavior

An exception is thown:

'#<HelloWorldComponent:0x00000001209635e0 @_routes=nil>' is not an ActiveModel-compatible object. It must implement :to_partial_path.

Backtrace:

actionview (7.0.8.3) lib/action_view/renderer/abstract_renderer.rb:82:in `partial_path'
actionview (7.0.8.3) lib/action_view/renderer/object_renderer.rb:20:in `render_object_derive_partial'
actionview (7.0.8.3) lib/action_view/renderer/renderer.rb:94:in `render_partial_to_object'
actionview (7.0.8.3) lib/action_view/renderer/renderer.rb:53:in `render_partial'
active_scaffold (3.7.4) lib/active_scaffold/extensions/action_view_rendering.rb:200:in `render'
active_scaffold (3.7.4) lib/active_scaffold/extensions/action_view_rendering.rb:69:in `render'
app/views/home/index.html.erb:1

System configuration

Rails version:
7.0.8.3

Ruby version:
3.3.1

Gem version:
3.12.1

@reeganviljoen
Copy link
Collaborator

reeganviljoen commented May 24, 2024

@juankiz thank you for the report

I don't know exactly what may have caused this and how to fix it, but if I have some time to investigate this I will let you know what I find

Also @joelhawksley @camertron what do you think

@joelhawksley
Copy link
Member

@juankiz I'd love for us to find a way for ViewComponent to not conflict with active_scaffold. Might you be up for writing a PR with a failing test and see if you can come up with a fix?

@planetmcd
Copy link

Hey @joelhawksley, long time no see. I hope all is well.

I just stumbled upon this bug too. I'm looking to dump ActiveScaffold, so will just do that before I introduce ViewComponents. Just chiming in as a second example.

@joelhawksley
Copy link
Member

Oh hey @planetmcd! I still say not in my parish because of you 😂

Thanks for the corroborating report ❤

@planetmcd
Copy link

Love that. Thanks for spearheading this library!

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

4 participants