Ruby on Rails
Tuesday, May 6, 2014
I have a script:
$ ->
$(document).on 'change', ('.ops_select'), ->
val = $(".ops_select option:selected").val()
$.ajax '/projects/update_oncalls/',
type: 'GET'
dataType: 'script'
data: {ops_group_id: val }
which triggers a "update_concalls.js.coffee" file to replace a the value in a select-tag.
$(".oncalls_select").empty().append("<%= escape_javascript(render(:partial => @oncalls)) %>")
As I have multiple instances of ".ops_select" I want to bind it to the recent selected and update only this.
I have tried to fiddle in the closest function but can't succed.
Some help would be great.
Thanks
-- $ ->
$(document).on 'change', ('.ops_select'), ->
val = $(".ops_select option:selected").val()
$.ajax '/projects/update_oncalls/',
type: 'GET'
dataType: 'script'
data: {ops_group_id: val }
which triggers a "update_concalls.js.coffee" file to replace a the value in a select-tag.
$(".oncalls_select").empty().append("<%= escape_javascript(render(:partial => @oncalls)) %>")
As I have multiple instances of ".ops_select" I want to bind it to the recent selected and update only this.
I have tried to fiddle in the closest function but can't succed.
Some help would be great.
Thanks
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8f0483a5-0ec9-4892-8137-8e2dc52fda6b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment