Skip to content

Restore submit_tag for AA 3.x login button styling#8

Merged
Fivell merged 3 commits into
mainfrom
restore-aa3-login-button-styling
Jun 2, 2026
Merged

Restore submit_tag for AA 3.x login button styling#8
Fivell merged 3 commits into
mainfrom
restore-aa3-login-button-styling

Conversation

@Fivell

@Fivell Fivell commented Jun 2, 2026

Copy link
Copy Markdown
Member

Summary

Restores the themed (formtastic-blue) SSO login button on ActiveAdmin 3.x. Commit 15e89a0 (add support of active admin v4) replaced submit_tag inside form_tag with button_to for both AA v3 and v4 branches. AA v4 is happy with button_to because Tailwind classes do the styling — but AA v3's formtastic stylesheet targets #login input[type="submit"], and <button type="submit"> doesn't match that selector, so the SSO button regressed from the themed blue to the unstyled dark default.

Fix

Keep button_to in the AA v4 branch (Tailwind handles it). Revert the AA v3 (else) branch to form_tag + submit_tag so the formtastic-themed look is back. The wrapping form picks up the .formtastic class so AA's stylesheet applies.

Before / after

Before (v2.0.x) After
AA v3 button Dark, unstyled <button> (regression) Blue formtastic-themed <input type="submit"> (matches v1.0 look)
AA v4 button Tailwind-styled button_to (unchanged) Tailwind-styled button_to (unchanged)

Test plan

  • rake spec:all is green.
  • Eyeball the login page on a host app running AA v3 — button is themed blue again.

Fivell added 3 commits June 2, 2026 13:55
The add-AA-v4-support change (commit 15e89a0) flipped both view branches from submit_tag inside form_tag to button_to. That works for the AA v4 branch (Tailwind classes do the styling), but on AA v3 the formtastic theme styles `#login input[type="submit"]` — a <button> element doesn't match the selector, so the SSO button regressed from the themed blue to an unstyled dark default.

Keep button_to in the AA v4 branch; revert the AA v3 (else) branch to form_tag + submit_tag so the formtastic-themed look is back. The wrapping form picks up the .formtastic class so AA's stylesheet applies.
Regression test for the styling fix: AA v3's formtastic stylesheet targets #login input[type="submit"], and a <button> doesn't match the selector. The spec asserts the rendered login page uses input[type=submit] on AA v3 (skipped on AA v4 where button_to + Tailwind is intentional) so future view edits can't silently regress the themed blue button back to a dark default.
The install generator (`rails generate active_admin:oidc:install`) copies templates/sessions_new.html.erb to the host app for AA v3. That template carried the same button_to-based markup the gem-side view did, so host apps that ran the installer (and ones that do so after this fix lands) would still see the dark unstyled SSO button until they hand-edited their own override.
@Fivell Fivell merged commit 36b91bb into main Jun 2, 2026
6 checks passed
@Fivell Fivell deleted the restore-aa3-login-button-styling branch June 2, 2026 13:16
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

Successfully merging this pull request may close these issues.

1 participant