Develop pagination with ajax in Rails Application.
Gem Used for pagination
Add gem in Gemfile
run "rm public/index.html" | |
add_source "https://rubygems.org" | |
require 'rbconfig' | |
require 'open-uri' | |
require 'net/http' | |
gsub_file 'Gemfile', "gem 'jquery-rails'", "gem 'jquery-rails', '~> 2.0'" | |
gem 'devise' | |
gem 'activeadmin' |
Develop pagination with ajax in Rails Application.
Gem Used for pagination
Add gem in Gemfile
require 'rbconfig' | |
require 'open-uri' | |
gsub_file 'Gemfile', "gem 'jquery-rails'", "gem 'jquery-rails', '~> 2.2.1'" | |
gsub_file 'Gemfile', "# gem 'therubyracer', :platforms => :ruby", "gem 'therubyracer', :platforms => :ruby" | |
if File.read("#{destination_root}/Gemfile") !~ /assets.+coffee-rails/m | |
gem "coffee-rails", :group => :assets | |
end |
#---------------------------------------------------------------------------- | |
# Ignore these files when commiting to a git repository. | |
# | |
# See http://help.github.com/ignore-files/ for more about ignoring files. | |
# | |
#---------------------------------------------------------------------------- | |
# bundler state | |
/.bundle | |
/vendor/bundle/ |
PostgreSQL | |
# Install the database packages | |
sudo apt-get install -y postgresql-9.1 libpq-dev | |
# Login to PostgreSQL | |
sudo -u postgres psql -d template1 | |
# Create a user for GitLab. (change $password to a real password) | |
template1=# CREATE USER git WITH PASSWORD '$password'; |
MySQL | |
# Install the database packages | |
sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev | |
# Pick a database root password (can be anything), type it and press enter | |
# Retype the database root password and press enter | |
# Login to MySQL | |
mysql -u root -p |
# SQLite version 3.x | |
# gem install sqlite3-ruby (not necessary on OS X Leopard) | |
development: | |
adapter: sqlite3 | |
database: db/development.sqlite3 | |
pool: 5 | |
timeout: 5000 | |
# Warning: The database defined as "test" will be erased and | |
# re-generated from your development database when you run "rake". |
# MySQL. Versions 4.1 and 5.0 are recommended. | |
# | |
# Install the MySQL driver: | |
# gem install mysql2 | |
# | |
# And be sure to use new-style password hashing: | |
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
development: | |
adapter: mysql2 | |
encoding: utf8 |
# install rvm | |
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) | |
# install ruby 1.9.2 + some global gems | |
rvm install 1.9.2 | |
rvm use 1.9.2@global | |
gem install awesome_print map_by_method wirble bundler builder pg cheat | |
gem install -v2.1.2 builder | |
run this script on a fresh Ubuntu server installation as non-root user | |
# version numbers for various packages | |
NGINX_VERSION=1.0.8 | |
# copy public ssh key to server's authorized_keys keychain for simple ssh logins | |
#mkdir -p ~/.ssh | |
#echo -e '<your ssh public key here>' > ~/.ssh/authorized_keys | |