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 :aws_servers, `/usr/bin/curl -s 'http://url.aws/show'`.split(', ') | |
set :rails_env, "production" | |
set :user, "deploy" | |
set :runner, "deploy" | |
set :branch, "master" | |
aws_servers.each do |aws_server| | |
role :app, aws_server | |
role :web, aws_server | |
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
# Script to test stemming for ElasticSearch. Working now!! | |
# Reference: http://stackoverflow.com/questions/4981001/why-elasticsearch-is-not-finding-my-term | |
require 'rubygems' | |
require 'net/http' | |
require 'yaml' | |
require 'json' | |
# kill the index | |
delete = Net::HTTP::Delete.new("/willindex") |
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
require 'spec_helper' | |
feature "Rating" do | |
let(:current_user){ Factory(:user) } | |
let(:post){ Factory(:post) } | |
let!(:comment){ Factory(:comment, :commentable => post) } | |
background do | |
sign_in_as(current_user) | |
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
## Controller | |
def rate | |
@book = Book.find(params[:id]) | |
@book.rate params[:rating].to_i | |
render :update do |page| | |
page.replace_html("rating", {:partial => "rate", :locals => {:rateable => @book}}) | |
page.show "success_rating" | |
end | |
end |