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

fix: allow remote submissions on formInputSelectors #145

Merged
merged 2 commits into from
Oct 15, 2021

Conversation

KonnorRogers
Copy link
Owner

Status

Ready

Additional Notes

(Docs to follow)

  • Supports data-remote on formInputSelectors (input, select, textarea)
  • Allows specifying data-params which will take a 1 level deep stringified object:
// Allowed
data-params='{"name": "value"}'

// Disallowed
data-params='{"user": { "name": "value" }'

Other examples:

https://gist.github.com/rickychilcott/b964fdd3506564aa810bd562c69e9ea0

If coming from Rails, this is allowed:

data: { params: {
                  action_item: {
                      completed: !action_item.completed? ? "1" : "0" }
                   }.to_param
              }
           }

This is because to_param (or to_query) turns the hash into this: action_item: "completed=1"

https://api.rubyonrails.org/classes/ActionController/Parameters.html#method-i-to_query

@netlify
Copy link

netlify bot commented Oct 15, 2021

✔️ Deploy Preview for mrujs canceled.

🔨 Explore the source changes: 1ac848b

🔍 Inspect the deploy log: https://app.netlify.com/sites/mrujs/deploys/6169c68909d02c00088bd15a

@KonnorRogers KonnorRogers merged commit fb57a39 into main Oct 15, 2021
@KonnorRogers KonnorRogers deleted the fix/remote-submissions branch October 15, 2021 19:29
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