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
# this assert | |
assert ActionMailer::Base.deliveries.present? | |
# gives this error when running tests | |
NoMethodError: undefined method `deliveries' for #<TMail::Mail:0x1094e3a90> | |
/test/unit/user_test.rb:69:in `test_should_create_token_and_email' |
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
var app = wrench.appify({ | |
init: function () { | |
// this will run after in the boot up process initiated by app.run(); | |
}, | |
users: { | |
list: route("users/list/").to(function () { | |
// fetch all the users and show them on the page | |
}), |
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 | |
/* | |
Template Name: Page with downloads | |
*/ | |
?> | |
<?php the_post(); ?> | |
<?php get_header(); ?> | |
<?php get_sidebar(); ?> | |
<div id="mainContent"> |
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 Release < ActiveRecord::Base | |
has_many :release_sites | |
has_many :sites, :through => :release_sites | |
end | |
class Site < ActiveRecord::Base | |
has_many :release_sites | |
has_many :releases, :through => :release_sites | |
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
@contact = Contact.find(params[:id]) | |
raise url_for(contacts_url(@contact)) | |
# http://localhost:3000/contacts.986060960 | |
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
// THIS IS A SUPER PRESENTER?! | |
YUI.add("presenters:your_rewards", function (Y) { | |
Y.YourRewardsPresenter = Y.Base.create("YourRewardsPresenter", Y.Presenter, [], { | |
initializer: function (options) { | |
this.yourPlacesPresenter = new Y.YourPlacesPresenter({}); | |
this.yourCashPresenter = new Y.YourCashPresenter({}); |
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
host[model.isNew() ? "destroy" : "render"](); | |
// vs | |
if (model.isNew()) host.destroy(); | |
else host.render(); |
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
YUI.add('location-search-view', function (Y) { | |
/** | |
@class LocationSearchView | |
@extends View | |
@constructor | |
**/ | |
Y.LocationSearchView = Y.Base.create('view', | |
Y.View, | |
[], |
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
(function () { | |
// initiate the application loader | |
var appLoader = new Swipely.AppLoader({ | |
slowText: 'Hold tight, almost done...', | |
errorText: "Oh dear, we had a problem loading. We're sorry, please try again." | |
}); | |
// boot the application | |
YUI().use('partners:app', function (Y) { |