rails-ujs: missing default url for ajax requests. #28722
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Steps to reproduce
Hi!
I'm using rails 5.1.0.rc1 and faced with next unexpected behaviour.
According to documentation I can set
remote: true
onselect
element like next:And in this case everything will work.
But actually I can remove
url
Expected behavior
When we use
jquery_ujs
and use$.ajax
function:This
ajax
function provides default value forurl
if it is not specified.Actual behavior
Currently if I remove
url
option fromselect_tag
I will receive an error:System configuration
Rails version:
5.1.0.rc1
Ruby version:
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin15]
Other Information
Maybe you had reasons not to do this.
Thanks.