-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html.haml
27 lines (24 loc) · 1.01 KB
/
index.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
- content_for :javascript do
:javascript
opts = {
totalPages : "#{(@number_of_users % Noladex::Application.config.page_size) > 0 ? (@number_of_users / Noladex::Application.config.page_size) + 1 : (@number_of_users / Noladex::Application.config.page_size)}",
url : '/users',
loaderMsg : 'Getting more noladexers',
params : {
selected : $('#selected_noladexers').val(),
category : "#{params[:category]}"
},
scrape : function(data) {
alreadySelected = $('#selected_noladexers').val().split(',')
$(data).siblings("div.person").each(function(index) {
newId = parseInt($(this).attr("id").split("-")[1]);
alreadySelected.push(newId);
});
$('#selected_noladexers').val(alreadySelected.join(','));
}
}
$('#people').pageless(opts);
= semantic_form_for :selected do |f|
= f.hidden_field :noladexers, :value => @users.map {|u| u.id}.join(',')
= render @users
= will_paginate @users