-
Notifications
You must be signed in to change notification settings - Fork 508
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
Add data-params handling to handleMethod #395
base: master
Are you sure you want to change the base?
Conversation
👍 good feature! |
👍 would love to see this merged soon ;-) |
It seems like this is re-building the functionality of a If it needs to look like a link, that can be achieved through CSS (see bootstrap's |
Yes. This is doing the same as |
@ecbypi, functionality of a <a href="/admin/parsings" data-method="post" data-params='{"kind_id": "1"}'>Start some kind parsing</a>" |
I don't think we should promote JSON usage on data tags. If you need to pass params in a link use the |
@rafaelfranca and how to use |
It created hidden inputs inside the form tag. |
@rafaelfranca, do you think reasonable that parameters are passed in this case: <a href="/admin/parsings" data-remote="true" data-method="post" data-params='{"kind_id": "1"}'>Start some kind parsing</a>" but there is no way? <a href="/admin/parsings" data-method="post" data-params='{"kind_id": "1"}'>Start some kind parsing</a>" Both constructions are handled by jquery-ujs, but in the second case surprisingly no parameters are passed. |
O_O. If first is working, there is no reason for the second to not work. |
I add test for first case, demonstrate coorrect work of JSON params. |
@rafaelfranca what do you think about this PR? |
I prefer to defer this decision to @JangoSteve or @lucasmazza? |
Sorry, I had to go back and read through the conversation from #307 to remind myself of the initial intent and discussion. There are a few issues with this PR as it stands, that lead me to believe that #307 might be closer to the desired implementation:
|
@JangoSteve, I see. I agree with your arguments. Work on this at the end of the week. |
@KODerFunk Awesome, sounds good! Thanks! |
👍 For this PR |
👍 |
Is there no progress on this? We (especially me) need this feature. |
I was rather surprised to find that this doesn't work. 😞 |
This commit adds the functionality to fetch the data-params attribute from the link and add fields to the form that express the values from the data-param attributes.
This is useful for POST-requests via links that should post parameters instead of sending them in the URL.
My version of forgotten #307 from @phillipp, with escaping and composing hidden inputs from complex objects by @bcm's request.