First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel
Then ssh with root account, run this in termianl:
$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
require 'fileutils' | |
namespace :db do | |
desc 'pull the production PostgreSQL database into the development SQLite' | |
task :pull do | |
Rake::Task['db:download_pg_dump'].invoke | |
Rake::Task['db:optimze_pg_dump_for_sqlite'].invoke | |
Rake::Task['db:recreate_with_dump'].invoke | |
end |
require "xmlsimple" | |
def transactions(filename) | |
data = XmlSimple.xml_in(filename) | |
data["LIST_G_CLIENT"][0]['G_CLIENT'][0]['LIST_G_ACC_CURR'][0]['G_ACC_CURR'][0]['LIST_G_TRANS_CARD'][0]['G_TRANS_CARD'][1]['LIST_G_TRANS_DETAILS'][0]['G_TRANS_DETAILS'] | |
end | |
fields = %w(TRANS_DATE_XML TRANS_AMOUNT TRANS_CURR ACC_AMOUNT TRANS_DETAILS ) | |
puts fields.join(", ") |
[core] | |
... | |
[remote "dokku"] | |
url = git@remote:appname | |
fetch = +refs/heads/*:refs/remotes/dokku/* |
namespace :routes do | |
desc "Writes doc/routes.html. Requires Graphviz (dot)" | |
task :visualizer => :environment do | |
File.open(Rails.root.join('doc', 'routes.html'), 'wb') do |f| | |
f.write Rails.application.routes.router.visualizer | |
end | |
end | |
end |
По дефолту для Mongoid он пагинирует Criteria. Если нужно Ruby-Array-массив: | |
Kaminary.paginate_array(...) |
# Capistrano configuration | |
# | |
# require 'new_relic/recipes' - Newrelic notification about deployment | |
# require 'capistrano/ext/multistage' - We use 2 deployment environment: staging and production. | |
# set :deploy_via, :remote_cache - fetch only latest changes during deployment | |
# set :normalize_asset_timestamps - no need to touch (date modification) every assets | |
# "deploy:web:disable" - traditional maintenance page (during DB migrations deployment) | |
# task :restart - Unicorn with preload_app should be reloaded by USR2+QUIT signals, not HUP | |
# Capistrano configuration | |
# | |
# require 'new_relic/recipes' - Newrelic notification about deployment | |
# require 'capistrano/ext/multistage' - We use 2 deployment environment: staging and production. | |
# set :deploy_via, :remote_cache - fetch only latest changes during deployment | |
# set :normalize_asset_timestamps - no need to touch (date modification) every assets | |
# "deploy:web:disable" - traditional maintenance page (during DB migrations deployment) | |
# task :restart - Unicorn with preload_app should be reloaded by USR2+QUIT signals, not HUP | |
# Capistrano configuration | |
# | |
# require 'new_relic/recipes' - Newrelic notification about deployment | |
# require 'capistrano/ext/multistage' - We use 2 deployment environment: staging and production. | |
# set :deploy_via, :remote_cache - fetch only latest changes during deployment | |
# set :normalize_asset_timestamps - no need to touch (date modification) every assets | |
# "deploy:web:disable" - traditional maintenance page (during DB migrations deployment) | |
# task :restart - Unicorn with preload_app should be reloaded by USR2+QUIT signals, not HUP | |
Having a buckload of code to authorize users on your application is something you may like or not.
Speaking for myself I hate it. But I still love rails_admin
, here's how you install it without devise. Thanks to phoet for providing the hints in the gist I have forked from.
do NOT add devise
gem "rails_admin", :git => "git://github.com/sferik/rails_admin.git"