Skip to content

Instantly share code, notes, and snippets.

@leylaKapi
Created October 2, 2017 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leylaKapi/0007212cda012daf30a5eae9f4e0b83a to your computer and use it in GitHub Desktop.
Save leylaKapi/0007212cda012daf30a5eae9f4e0b83a to your computer and use it in GitHub Desktop.
Select-tag add link
<%= 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>
= 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
@leylaKapi
Copy link
Author

You can select one method. Because above files solved same issue for select-tag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment