This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; | |
#pid logs/nginx.pid; | |
events { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
passenger_root /home/me/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12; | |
passenger_ruby /home/me/.rvm/wrappers/ruby-1.9.3-p194/ruby; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'rails', '3.2.3' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'sqlite3' | |
gem 'spree', '1.1.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!--[if lt IE 7 ]> <html class="ie ie6" lang="en"> <![endif]--><!--[if IE 7 ]> <html class="ie ie7" lang="en"> <![endif]--><!--[if IE 8 ]> <html class="ie ie8" lang="en"> <![endif]--><!--[if IE 9 ]> <html class="ie ie9" lang="en"> <![endif]--><!--[if gt IE 9]><!--><html lang="en"> | |
<!--<![endif]--><head data-hook="inside_head"> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta charset="utf-8"> | |
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame --> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>Spree Demo Site</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_for (@products) do |f| %> | |
<%= f.label "Colors" %> | |
<% for color in Color.all %> | |
<%= check_box_tag 'product[color_ids][]', color.id, | |
@product.color_ids.include?(color.id), :id => dom_id(color) %> | |
<%= label_tag dom_id(colore), color.name, :class => "check_box_label" %> | |
<br /> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vagrant@lucid32:/vagrant/demoapp/shared$ cat /etc/fstab | |
# /etc/fstab: static file system information. | |
# | |
# Use 'blkid -o value -s UUID' to print the universally unique identifier | |
# for a device; this may be used with UUID= as a more robust way to name | |
# devices that works even if disks are added and removed. See fstab(5). | |
# | |
# <file system> <mount point> <type> <options> <dump> <pass> | |
proc /proc proc nodev,noexec,nosuid 0 0 | |
/dev/mapper/lucid32-root / ext4 errors=remount-ro 0 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/deploy.rb | |
require "bundler/capistrano" | |
set :scm, :git | |
set :repository, "git@github.com:itsNikolay/demoapp.git" | |
set :branch, "origin/master" | |
set :migrate_target, :current | |
set :ssh_options, { :forward_agent => true } | |
set :rails_env, "production" | |
set :deploy_to, "/vagrant/demoapp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ContractFile < ActiveRecord::Base | |
belongs_to :contract, :polymorphic => true | |
has_attached_file :data, | |
:url => "/assets/paperclip/:parent_id/:attachment/:id/:style/:filename" | |
#:url => '/public/system/:attachment/foto_:basename.:extension', | |
#:url => '/assets/:id/foto_:basename.:extension' | |
validates_attachment_size :data, :less_than => 5.megabytes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/nginx/sites-available/default | |
upstream my_site { | |
# fail_timeout=0 means we always retry an upstream even if it failed | |
# to return a good HTTP response (in case the Unicorn master nukes a | |
# single worker for timing out). | |
# for UNIX domain socket setups: | |
server unix:/tmp/my_site.socket fail_timeout=0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
itsnikolay@itsnikolay-VirtualBox:~/projects/demoapp$ cap deploy * executing `deploy' | |
* executing `deploy:update' | |
** transaction: start | |
* executing `deploy:update_code' | |
* executing "cd /home/vagrant/projects/demoapp/current; git fetch origin; git reset --hard origin/master" | |
servers: ["33.33.33.10"] | |
Password: | |
[33.33.33.10] executing command | |
** [out :: 33.33.33.10] HEAD is now at 5347b5a first commit | |
command finished in 9647ms |