We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
::Components::Base
::Phlex::HTML
1 parent 518c791 commit ce729f8Copy full SHA for ce729f8
lib/superform/rails.rb
@@ -2,8 +2,10 @@
2
3
module Superform
4
module Rails
5
- # The `ApplicationComponent` is the superclass for all components in your application.
6
- Component = ::Phlex::HTML
+ # When this is included in a Rails app, check if `Components::Base` is defined and
+ # inherit from that so we get all the users stuff; otherwise inherit from Phlex::HTML,
7
+ # which means we won't have all the users methods and overrides.
8
+ Component = defined?(::Components::Base) ? ::Components::Base : ::Phlex::HTML
9
10
# A Phlex::HTML view module that accepts a model and sets a `Superform::Namespace`
11
# with the `Object#model_name` as the key and maps the object to form fields
0 commit comments