This file contains hidden or 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
## layouts/home.html.erb | |
<% content_for :home do %> | |
<%= yield %> | |
<% end %> | |
<% render :file => 'layouts/application' %> |
This file contains hidden or 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
## layouts/home.html.erb | |
<% content_for :home do %> | |
<%= yield %> | |
<% end %> | |
<% render :file => 'layouts/application' %> |
This file contains hidden or 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
## layouts/home.html.erb | |
<% content_for :home do %> | |
<%= yield %> | |
<% end %> | |
<% render :file => 'layouts/application' %> |
This file contains hidden or 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 4 | |
working_directory "/home/maletor/Sites/ellisberner/" | |
listen "/home/maletor/ellisberner/tmp/sockets/unicorn.sock", :backlog => 2048 | |
timeout 30 | |
pid "/home/maletor/ellisberner/tmp/pids/unicorn.pid" |
This file contains hidden or 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 unicorn { | |
server unix:/home/maletor/Sites/ellisberner/tmp/sockets/unicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name ellisberner.com; | |
root /home/maletor/Sites/ellisberner/public; | |
This file contains hidden or 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
server { | |
listen 80; | |
server_name ellisberner.com; | |
access_log /var/log/nginx/localhost.access.log; | |
root /var/www/ellisberner.com/current/public; | |
location / { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
This file contains hidden or 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 :application, "ellisberner.com" | |
role :app, application | |
role :web, application | |
role :db, application, :primary => true | |
set :user, "www-data" | |
set :port, 2222 | |
set :deploy_to, "/var/www/#{application}" | |
set :repository, "git://github.com/maletor/ellisberner.git" |
This file contains hidden or 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
include Rakismet::Controller | |
rakismet_filter :only => :create | |
def create | |
@post = Post.find(params[:post_id]) | |
@comment = @post.comments.build(params[:comment]) | |
if @comment.spam? | |
flash[:error] = "This comment looks a lot like spam." |
This file contains hidden or 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
include Rakismet::Controller | |
rakismet_filter :only => :create | |
def create | |
@post = Post.find(params[:post_id]) | |
@comment = @post.comments.build(params[:comment]) | |
if @comment.spam? | |
flash[:error] = "This comment looks a lot like spam." |
This file contains hidden or 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 Comment < ActiveRecord::Base | |
include Rakismet::Model | |
belongs_to :post | |
validates_presence_of :author, :author_email, :content | |
validates_format_of :author_email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i | |
validates_format_of :author_url, :with => URI::regexp(%w(http https)), :allow_blank => true |
OlderNewer