Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveRecord validations breaks page UI #1369

Open
moneil868 opened this issue Jun 20, 2023 · 0 comments
Open

ActiveRecord validations breaks page UI #1369

moneil868 opened this issue Jun 20, 2023 · 0 comments

Comments

@moneil868
Copy link

I am unsure whether this issue should live in ActiveAdmin or Formtastic so I am creating it in both places. There seems to be some strange behaviour when attempting to submit a form (either edit or create) on a model containing ActiveRecord validations. For example, let's assume we have a User model with validates :name, presence: true

Current Behaviour

Screenshot 2023-06-20 at 11 36 13 AM

Attempting to submit this form will provide a validation error (as expected), except the page elements are not formatted as they should.

Screenshot 2023-06-20 at 11 37 22 AM

I am unsure why the page is injecting the HTML as plain text, nor I am able to find where this injection takes place.

<li class="string input error required stringish" id="user_first_name_input">&lt;label for="user_first_name" class="label"&gt;First name&lt;abbr title="required"&gt;*&lt;/abbr&gt;&lt;/label&gt;&lt;input id="user_first_name" type="text" value="" name="user[first_name]" /&gt;
<p class="inline-errors">can't be blank</p>
</li>

The problem appears to occur regardless of the type of validation message. Manually editing the HTML produces, what I can only assume, is the expected result.

<li class="string input error required stringish" id="user_first_name_input">
  <label for="user_first_name" class="label">First name</label>
  <input id="user_first_name" type="text" value="" name="user[first_name]">
<p class="inline-errors">can't be blank</p>
</li>
Screenshot 2023-06-20 at 11 43 19 AM

Gem versions

  • activeadmin (2.13.1)
  • formtastic (4.0.0)
  • jquery-rails (4.5.0)

ActiveAdmin issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant