File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,9 +90,18 @@ def component_action_exists?(action)
9090 # If it resolves a Phlex class in the controller, it will render that. If it's
9191 # not found it continues with Rails method of resolving action names.
9292 def method_for_action ( action_name )
93- super || if component_action_exists? action_name
94- "default_component_render"
95- end
93+ # Yep. `super` calls this, but we have to call it here to cover the
94+ # situation where the person uas a `./app/views/users/*.rb` file with a Ruby
95+ # class in it that might be included in the controller via `include Views::Users`.
96+ # If we call super first, it will tink that `./app/views/users/show.rb` is a template
97+ # and raise an error that it doesn't have a format.
98+ if action_method? ( action_name )
99+ action_name
100+ elsif component_action_exists? action_name
101+ "default_component_render"
102+ else
103+ super
104+ end
96105 end
97106
98107 # Renders a Phlex view for the given action, if it's present.
You can’t perform that action at this time.
0 commit comments