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
["<li class=\"\"><a href=\"/how-it-works\">How</a></li>", "<li class=\"\"><a href=\"/how-it-works\">About</a></li>"] |
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
generators = [] | |
puts 'Spinning up a new app, captain!' | |
devise = yes?('Use Devise? (yes/no)') | |
jquery = yes?('Use jQuery? (yes/no)') | |
jquery_ui = yes?('Use jQuery UI? (yes/no)') if jquery | |
mongoid = yes?('Use mongoid? (yes/no)') | |
haml = yes?('Use haml? (yes/no)') | |
rspec = yes?('Use Rspec? (yes/no)') |
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
set :sync_directories, ["public/system/images"] | |
set :sync_backups, 3 | |
set :db_file, "mongoid.yml" | |
set :db_drop, '--drop' # drop database (rewrites everything) |
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
Get notifications when there are migrations that need to be run in a Rails project: | |
https://img.skitch.com/20110418-c9y3ttap3tai7frc43f38qtb8e.jpg | |
In your Rails project edit the .git/config file to add the following: | |
[rails] | |
automigrate = false | |
automigrateforegroundcolor = yellow | |
automigratebackgroundcolor = black |
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 :rubygems | |
gem 'rails', '3.0.3' | |
gem 'mongo', '1.1.5' | |
gem 'bson', '1.1.5' | |
gem 'bson_ext', '1.1.5' | |
gem 'mongoid', '2.0.0.beta.20' | |
gem 'carrierwave' |
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
# Application Generator Template | |
# Modifies a Rails app to use Mongoid & Devise. | |
# Usage: rails new app_name -m http://gist.github.com/raw/991845/prepare.txt | |
# If you are customizing this template, you can use any methods provided by Thor::Actions | |
# http://rdoc.info/rdoc/wycats/thor/blob/f939a3e8a854616784cac1dcff04ef4f3ee5f7ff/Thor/Actions.html | |
# and Rails::Generators::Actions | |
# http://github.com/rails/rails/blob/master/railties/lib/rails/generators/actions.rb | |
puts "Modifying a new Rails app to use Mongoid & Devise..." |
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
<p>Welcome some email!</p> | |
<p>You can confirm your account through the link below:</p> | |
<p><a href="http://localhost/admin/confirmation?confirmation_token=KSwxjJyzEZAWK4rx24jh">Confirm my account</a></p> |
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 Attachment < ActiveRecord::Base | |
belongs_to :post | |
mount_uploader :filename, PostAttachmentUploader | |
VIDEO_FORMATS = %W{ogv mp4 webm} | |
PREVIEW_FORMAT = "jpeg" | |
before_save :set_metas | |
after_create :start_encoding!, :if => :video? | |
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
upstream app { | |
server unix:/srv/app/current/tmp/sockets/unicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name www.app.com; | |
rewrite ^/(.*) http://app.com/$1 permanent; | |
} | |
server { |
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
defaults: &defaults | |
host: localhost | |
# slaves: | |
# - host: slave1.local | |
# port: 27018 | |
# - host: slave2.local | |
# port: 27019 | |
development: | |
<<: *defaults |
OlderNewer