You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're running into an issue where our form's namespace is being set correctly only on fields that use formtastic's f.input method. An example is probably the best way to explain:
# plain Rails
= form_for @user, namespace: "abc" do |f|
= f.text_field :name #=> <input name="user[name]" id="abc_user_name"/>
= semantic_form_for @user, namespace: "abc" do |f|# GOOD
= f.input :name #=> <input name="user[name]" id="abc_user_name"/># BAD. We lose the namespace, because formtastic deleted it.
= f.text_field :name #=> <input name="user[name]" id="user_name">
I understand that formtastic's code for semantic_form_for is doing an custom_namespace = options.delete(:namespace), which removes the namespace when it delegates to form_for. I'm assuming this is so that the namespace is respected by formtastic and not duplicated by Rails.
I can't think of an easy way to prevent this issue, unless formtastic wraps every call to f.text_field/f.file_field, etc. So are there any workarounds?
The text was updated successfully, but these errors were encountered:
Hello, thanks for your work on this gem.
We're running into an issue where our form's
namespace
is being set correctly only on fields that use formtastic'sf.input
method. An example is probably the best way to explain:I understand that formtastic's code for
semantic_form_for
is doing ancustom_namespace = options.delete(:namespace)
, which removes the namespace when it delegates toform_for
. I'm assuming this is so that the namespace is respected by formtastic and not duplicated by Rails.I can't think of an easy way to prevent this issue, unless formtastic wraps every call to
f.text_field
/f.file_field
, etc. So are there any workarounds?The text was updated successfully, but these errors were encountered: