Hi everyone,
I'm trying to add SuperForm for the first time in my phlex app.
I try to add a really light form with only one field email for a contact form. No collection, no namespace etc..
I encounter a strange error within the default generated ApplicationForm on this line render component.field.label
class ApplicationForm < Superform::Rails::Form
include Phlex::Rails::Helpers::Pluralize
def row(component)
div do
render component.field.label
render component
end
end
# [...]
end
If I comment : render component.field.label my input is render with no errors.
So, render componentis working well.
I try with differents form versions :
V1 default Readme exemple -> ArgumentError wrong number of arguments (given 1, expected 2..4)
class Public::Contacts::Form < ApplicationForm
def view_template(&)
row field(:email).input
end
end
V2 bypass row -> ArgumentError [...] is not an ActiveModel-compatible object. It must implement #to_partial_path. Like: #39
class Public::Contacts::Form < ApplicationForm
def view_template(&)
render field(:email) do |f|
div do
f.label { "Email :" }
f.input
end
end
end
end
In V1 and V2, inputs are rendered without error if the label line is commented.
I don't understand why render component.field.label raise ArgumentError and not render component.
Maybe it's related to render changes in Phlex ?
Versions :
ruby : 3.3.0
phlex : 1.10.3
phlex-rails : 1.2.1
Note :
I started with SuperForm a few hours ago, so I apologize if I'm missing something obvious.
Hi everyone, I'm trying to add SuperForm for the first time in my phlex app. I try to add a really light form with only one field
email
for a contact form. No collection, no namespace etc..I encounter a strange error within the default generated
ApplicationForm
on this linerender component.field.label
If I comment :
render component.field.label
my input is render with no errors. So,render component
is working well.I try with differents form versions :
V1 default Readme exemple -> ArgumentError wrong number of arguments (given 1, expected 2..4)
V2 bypass
row
-> ArgumentError [...] is not an ActiveModel-compatible object. It must implement #to_partial_path. Like: #39In V1 and V2, inputs are rendered without error if the label line is commented. I don't understand why
render component.field.label
raise ArgumentError and notrender component
. Maybe it's related torender
changes in Phlex ?Versions :
Note :