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
<!-- AddThis Button BEGIN --> | |
<div class="addthis_toolbox addthis_default_style "> | |
<a class="addthis_button_preferred_1"></a> | |
<a class="addthis_button_preferred_2"></a> | |
</div> | |
<script> | |
var addthis_config = { | |
services_compact: 'twitter, facebook', | |
services_exclude: 'print' | |
} |
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
<?php | |
// Default Values | |
ini_set('display_errors', 1); | |
// Load Application | |
require 'application/wildfire.php'; | |
?> |
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 Message < ActiveRecord::Base | |
before_save :check_active_message | |
def check_active_message | |
if self.active | |
Message.where(:active => true).first.update_attributes(:active => false) | |
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
// Is there a name for this pattern? I would love some resources to read about pros/cons using it. | |
var FOO = FOO || {}; | |
FOO.ui = {}; | |
FOO.ui.prep_links = function(){ | |
// Some Vars |
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
module SomeHelper | |
def metrics(account) | |
opens = ContactSnapshot.opens(account, Time.zone.now-30.days, Time.zone.now).size | |
content_tag :ul do | |
content_tag :li, "#{opens} Opens." | |
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
# First | |
content.should have_selector("a.current", :content => "Remove") | |
# Second | |
content.should have_selector("a.current", "Remove") | |
# Which one would you prefer, and why? |
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
# Option 1: | |
# Use content to separate the helper from the spec | |
it "should have something" do | |
content = helper.some_helper_method | |
content.should have_tag('a', :text => 'foo') | |
end | |
# Option 2: | |
# Combine helper call and spec |
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
# Option 1: | |
# Use content to separate the helper from the spec | |
it "should have something" do | |
content = helper.some_helper_method | |
content.should have_tag('a', :text => 'foo') | |
end | |
# Option 2: | |
# Combine helper call and spec |
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
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 |
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 BrandIdentity < ActiveRecord::Base | |
has_one :library_asset, :dependent => :destroy, :as => :asset | |
end |