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 BooksController < ApplicationController | |
before_filter :authorize, :only => [:new, :create, :edit, :update, :destroy] | |
load_and_authorize_resource | |
# GET /books | |
# GET /books.xml | |
def index | |
@title = "Books" | |
respond_to do |format| |
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
I am a jerk |
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
STATES = %w(reading pending completed wishlist) | |
STATES.each do |state| | |
define_method "#{state}?" do | |
self.state == state | |
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
ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!({ | |
:month_and_year => "%B %Y" | |
}) | |
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 'http://rubygems.org' | |
gem 'rails', '3.1.0.rc4' | |
gem 'mysql2' | |
gem "clearance", :git => "git://github.com/thoughtbot/clearance.git" | |
gem 'cancan' | |
gem 'heroku' | |
gem 'paperclip', '~> 2.3' | |
gem 'aws-s3', :require => 'aws/s3' | |
gem 'formtastic' |
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
select * from orders join order_statuses on orders.id=order_statuses.order_id where order_statuses.status not in ('test', 'test_failed', 'test_sent', 'test_queued'); |
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
<header> | |
<h1>Test</h1> | |
<nav> | |
<a href="#">Test Link</a> | |
<a href="#">Test Link</a> | |
<a href="#">Test Link</a> | |
</nav> | |
<img /> | |
</header> |
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 BrandIdentity < ActiveRecord::Base | |
has_one :library_asset, :dependent => :destroy, :as => :asset | |
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
emails = [] | |
recipient.contact.emails.each do |email| | |
emails << content_tag(:li) do | |
form.radio_button(:email, email.address, :class => "radio-button") | |
form.label(:email, nil, :value => email.address) do | |
"<span>#{email.location}</span>" | |
end | |
end | |
end | |
emails.join |
OlderNewer