table.table tr th Username - @roles.each do |role| th = role.to_s.titleize end - @users.each do |user| tr td = user.username - @roles.each do |role| td = form_for user, url: role_user_path(user), method: :put do |f| - operation, activation, btn_class = user.has_role?(role) ? \ %w(revoke active btn-success) : %w(grant inactive btn-danger) = hidden_field_tag :operation, operation = hidden_field_tag :role, role = f.submit activation, class: "btn \#{btn_class}"