osem-fcy/app/views/admin/conference/roles.html.haml
2014-08-13 22:53:13 +03:00

22 lines
550 B
Text

.row
.col-md-6
= semantic_form_for(:user, url: roles_admin_conference_path(@conference.short_title), remote: true) do |f|
%h4
= f.input :roles, collection: @roles, label: 'Show users for role: '
= render partial: 'roles'
:javascript
$("#user_roles_input").change(function () {
var url = document.forms[0].action;
var selected_role = $(this).find('option:selected').attr('value');
$.ajax({
url: url,
type: "POST",
data: {user: { roles: selected_role } },
dataType: "script"
});
});