Created
October 2, 2017 14:10
-
-
Save leylaKapi/0007212cda012daf30a5eae9f4e0b83a to your computer and use it in GitHub Desktop.
Select-tag add link
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= select_tag 'team_id', options_from_collection_for_select(@teams, "id", "name") %> | |
<script> | |
$(function(){ | |
$('#team_id').bind('change', function () { | |
var url = "/Teamleader/" + $(this).val() | |
if (url) { | |
window.location.replace(url); | |
} | |
return false; | |
}); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= select_tag :frame, options_for_select(get_frames, :id), class: 'chosen-select form-control', prompt: 'Çerçeve seçiniz' | |
$ -> | |
$('#frame').bind 'change', -> | |
url = '/admin/blocks?frame_id=' + $(this).val() | |
if url | |
window.location.replace url | |
false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can select one method. Because above files solved same issue for select-tag