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

use form_with, requre email, handle rails 7 form redirect #128

Merged
merged 8 commits into from
Nov 30, 2022
Merged

use form_with, requre email, handle rails 7 form redirect #128

merged 8 commits into from
Nov 30, 2022

Conversation

yshmarov
Copy link
Contributor

@yshmarov yshmarov commented Nov 8, 2022

Hello @mikker !
I've been playing around with adding the gem, and noticed some minor things that could be improved. I hope my suggestions find you well:

  • form_with allows more options than form_for, it's easyer to style.
  • don't let the html form submit null email
  • data-turbo-false added for rails apps that user turbo & no ujs, so that the page does redirect on form submission. otherwise at the moment after form submission there is no redirect
  • add email validation regex to the example.
  • added ua.yml - one more language for i18n. hopefully native speakers will add other languages in the future. I need this one for my app to work in my region

@yshmarov yshmarov changed the title use form_with, requre email use form_with, requre email, handle rails 7 form redirect Nov 9, 2022
@mikker
Copy link
Owner

mikker commented Nov 14, 2022

Hey @yshmarov! Thank you for all these. Looks like decent additions.

How does form_with benefit styling? I imagine it'll add more or perhaps different ids and classes? Is this potentially a (very subtly and harmlessly) breaking change?

I can definitely see how it's nice to share translations however I fear bundling them in the gem will make it very hard to do updates as we'd have to wait for all translations to be ready before we can do breaking changes, etc... So maybe we can put the translations in the wiki here on GH instead?

It breaks my heart what's being done to your country and people. Rooting for you 💛💙

@yshmarov
Copy link
Contributor Author

Thanks for your reply & support @mikker !

form_with is supposed to unify form_for and form_tag, that seem to be slowly going obsolete rails/rails#26976

How does form_with benefit styling?

you don't have to apply id, data, class inside html_options

<%= form_with model: @post, id: “custom-id”, class: “custom-class” do |form| %>
<%= form_for @post, html: { id: “custom-id”, class: “custom-class” } do |form| %>

Is this potentially a (very subtly and harmlessly) breaking change?

I don't think so...

I can definitely see how it's nice to share translations however I fear bundling them in the gem will make it very hard to do updates as we'd have to wait for all translations to be ready before we can do breaking changes, etc... So maybe we can put the translations in the wiki here on GH instead?

Good point! You are right!

Copy link
Owner

@mikker mikker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Move translation to GH wiki
  • Add item to changelog

@yshmarov
Copy link
Contributor Author

@mikker I don't see the Wiki tab available on the repo. It might be disabled?

@mikker
Copy link
Owner

mikker commented Nov 30, 2022

Perfect 👌
I think the wiki is there now. I've created the first page.

Copy link
Owner

@mikker mikker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️🧡💛💚💙💜

CHANGELOG.md Outdated Show resolved Hide resolved
@mikker mikker merged commit 029d24e into mikker:master Nov 30, 2022
@yshmarov yshmarov deleted the form-with-require-email branch November 30, 2022 21:03
@yshmarov
Copy link
Contributor Author

@mikker looks like the wiki is not community-editable 🙃
Screenshot 2022-11-30 at 22 04 17

@mikker
Copy link
Owner

mikker commented Dec 1, 2022

Sorry, try again!

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.

None yet

2 participants