Skip to content

Commit

Permalink
removed will_paginate gem; fixed datatables accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
katafira committed Aug 29, 2016
1 parent e0a0a68 commit 53c7211
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 23 deletions.
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ gem 'bcrypt', '~> 3.1.7'
# Create multi-language
# gem "rails-i18n", :git => "git://github.com/svenfuchs/rails-i18n.git", :branch => "master"

# Paginate helper gem
gem 'bootstrap-will_paginate'
# Devise
gem 'devise', "~> 3.0" # 4.0 needs ruby 2.2

# Let's get a copy of documentation
Expand Down
10 changes: 3 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,14 @@ GEM
ansi (1.5.0)
arel (5.0.1.20140414130214)
ast (2.3.0)
autoprefixer-rails (6.4.0.2)
autoprefixer-rails (6.4.0.3)
execjs
bcrypt (3.1.11)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
bootstrap-will_paginate (0.0.10)
will_paginate
builder (3.2.2)
byebug (9.0.5)
capybara (2.7.1)
Expand Down Expand Up @@ -193,7 +191,7 @@ GEM
rspec-mocks (3.5.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-rails (3.5.1)
rspec-rails (3.5.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
Expand Down Expand Up @@ -254,7 +252,6 @@ GEM
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
websocket (1.2.3)
will_paginate (3.1.0)
xpath (2.0.0)
nokogiri (~> 1.3)

Expand All @@ -263,7 +260,6 @@ PLATFORMS

DEPENDENCIES
bcrypt (~> 3.1.7)
bootstrap-will_paginate
byebug
capybara (~> 2.7.0)
coffee-rails (~> 4.1.0)
Expand Down Expand Up @@ -299,4 +295,4 @@ DEPENDENCIES
web-console (~> 2.0)

BUNDLED WITH
1.11.2
1.12.5
12 changes: 2 additions & 10 deletions app/controllers/admin_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,15 @@ class AdminController < ApplicationController
before_action :admin_user?

def dashboard
@users = User.paginate(page: params[:users_page])
@offsprings = Offspring.paginate(page: params[:offsprings_page])
@users = User.all
@offsprings = Offspring.all
@rooms = Room.all
@users_count = User.where(admin: false).count
@offspring_count = Offspring.all.count
@zero_offspring_count = user_0_offspr_count
@users_with_at_least_2_offspring = user_2_offspr_count
end

def offsprings
@offsprings = Offspring.paginate(page: params[:page])
end

def rooms
@rooms = Room.all
end

private

def admin_user?
Expand Down
3 changes: 0 additions & 3 deletions app/views/offsprings/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<% provide(:title, 'Lista de catecúmenos') %>
<h1>Índice de catecúmenos</h1>

<%= will_paginate :previous_label => "Previo", :next_label => "Siguiente"%>
<table class="datatable table table-striped table-bordered table-hover">
<thead>
<tr>
Expand All @@ -22,5 +21,3 @@
$('.datatable').dataTable();
});
</script>

<%= will_paginate :previous_label => "Previo", :next_label => "Siguiente"%>

0 comments on commit 53c7211

Please sign in to comment.