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 Project < ActiveRecord::Base | |
attr_accessible :description, :name | |
has_many :user_projects | |
has_many :users, :through => :user_projects | |
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
class CreateProducts < ActiveRecord::Migration | |
def up | |
create_table :projects_users, :id => false do |t| | |
t.references :user, :null => false | |
t.references :project, :null => false | |
end | |
end | |
def down | |
drop_table :projects_users | |
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
class HomeController < ApplicationController | |
def index | |
@data = session[:omniauth_data] | |
end | |
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
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776 | |
$ cd /usr/src | |
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz | |
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz | |
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz | |
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz | |
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz |
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 Product < ApplicationRecord | |
scope :published, -> { | |
where(:is_published => true) | |
} | |
belongs_to :category | |
validates_presence_of :name, :price | |
mount_uploader :image, ImageUploader | |
validates_processing_of :image |
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
<%= render 'layouts/header' unless current_page?(root_url) %> |
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
Results of ping while running speedtest at http://www.dslreports.com/speedtest | |
PING google.com (173.194.192.102): 56 data bytes | |
64 bytes from 173.194.192.102: icmp_seq=0 ttl=42 time=41.444 ms | |
64 bytes from 173.194.192.102: icmp_seq=1 ttl=42 time=41.425 ms | |
64 bytes from 173.194.192.102: icmp_seq=2 ttl=42 time=41.300 ms | |
64 bytes from 173.194.192.102: icmp_seq=3 ttl=42 time=42.305 ms | |
64 bytes from 173.194.192.102: icmp_seq=4 ttl=42 time=44.678 ms | |
64 bytes from 173.194.192.102: icmp_seq=5 ttl=42 time=44.088 ms | |
64 bytes from 173.194.192.102: icmp_seq=6 ttl=42 time=48.350 ms |
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 WalkSectionController < ApplicationController | |
def go_for | |
@walk_section = WalkSection.find(params[:id]) | |
@walk = @walk_section.walk | |
# full_url = request.base_url + request.path | |
# i = full_url.rindex( '/' ) | |
@base_url = request.base_url | |
@walk_section_buttons = @walk_section.walk_section_buttons | |
end |