Skip to content

Overriding inherited partials #411

Description

@awead

Steps to reproduce

When inheriting view component from another Rails gem, I was expecting to be able to override a component's partial in my local app. For example:

Given:

[gem_home]/app/components/some_component.html.erb

A local file with the same name and location:

app/components/some_component.html.erb

Would replace/override the content of the gem's partial.

Expected behavior

I was expecting what Rails does with other types such as views, and replace/override the content of the gem's partial.

Actual behavior

It doesn't seem to. I can sub-class the gem's component Ruby class and write my own partial, which is fine, but I'm wondering if this is a bug and we should expect overriding things the way we typically to with other things.

System configuration

Rails version: 6.0.3.2

Ruby version: 2.6.6p146

Gem version: 2.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions