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
# https://groups.google.com/forum/?fromgroups=#!topic/phillyrb/SwN1G2Ek158 | |
class UserAddressesController | |
def create | |
@user_address = current_user.user_addresses.build(params[:user_address]) | |
if @user_address.save | |
#... | |
end | |
end | |
end |
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
# https://groups.google.com/forum/?fromgroups=#!topic/phillyrb/SwN1G2Ek158 | |
class UserAddressesController | |
def create | |
@user_address = current_user.user_addresses.build(params[:user][:user_address]) | |
if @user_address.save | |
#... | |
end | |
end | |
end |
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
def auth_check | |
if logged_in? | |
redirect_to 'http://www.msn.com' and return | |
elsif params[:action] != 'login' && params[:action] != 'login_attempt' | |
redirect_to '/login' and return | |
end | |
end |
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
describe Listing, ".smallish" do | |
let!(:tiny_listing) { create(:listing, :size => 'tiny') } | |
subject { Listing.smallish } | |
it { should include tiny_listing } | |
end |
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
describe TournamentRegistration do | |
let(:registration) { | |
create(:tournament_registration, :team_name => "Mighty Badgers") | |
} | |
subject { registration } | |
its(:to_param) { should == "#{registration.id}-mighty-badgers" } | |
end |
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
(1..5).map{|number| number.to_s } | |
# => ["1", "2", "3", "4", "5"] | |
(1..5).map(&:to_s) | |
# => ["1", "2", "3", "4", "5"] |
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
require 'spec_helper' | |
class Foo | |
def self.string(capitalize=false) | |
capitalize ? 'FOO' : 'foo' | |
end | |
def three_strings | |
[ self.class.string, self.class.string(true), self.class.string, self.class.string(true)] | |
end |
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
[couchrest_model] $ rspec spec/couchrest/class_proxy_spec.rb | |
.............F...... | |
Failures: | |
1) Proxy Class should get last | |
Failure/Error: u.title.should == "aaa" | |
expected: "aaa", | |
got: "bbb" (using ==) | |
# ./spec/couchrest/class_proxy_spec.rb:93 |
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 DirectionsController < ApplicationController | |
def new | |
@direction = Direction.new | |
@venues = Venue.all | |
end | |
def create | |
@direction = Direction.new(params[:direction]) | |
respond_to do |format| | |
format.html do |
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
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.14 | |
PassengerRuby /usr/bin/ruby | |
PassengerLogLevel 0 | |
PassengerUseGlobalQueue On | |
PassengerUserSwitching On | |
PassengerDefaultUser rails | |
PassengerMaxPoolSize 30 | |
PassengerMaxInstancesPerApp 0 | |
PassengerPoolIdleTime 0 |
NewerOlder