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: | |
- rubocop-rails | |
- rubocop-rspec | |
- rubocop-factory_bot | |
AllCops: | |
Exclude: | |
- '**/Guardfile' | |
- 'bin/*' | |
- 'out/**/*' |
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 Defaults | |
extend ActiveSupport::Concern | |
included do | |
# Make sure #set_default_values is called after initialize | |
after_initialize :set_default_values | |
# Set default values before initialize | |
def set_default_values | |
self.class.defaults.each do |attribute, param| |
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 Widget | |
# BusinessSearch widget | |
# | |
# Attributes: | |
# | |
# cache - Total seconds to cache the data from this widget | |
# type_list - Types of businesses to search | |
# | |
# Methods: | |
# |
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
$scope.lookup = function() { | |
var path = "api/v1/" + $scope.type + ".json"; | |
var businesses = Restangular.all(path); | |
var filters = angular.copy($scope.filters); | |
_.each(filters, function(value, index) { | |
if (value instanceof Array) { | |
filters[index + '[]'] = value; | |
delete filters[index]; | |
} |
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
// Restaurants finder | |
ink.controller('FinderRestaurantCtrl', ['$scope', 'Restaurant', 'Geocoder', function($scope, Restaurant, Geocoder) { | |
// Businesses | |
$scope.businesses = []; | |
// Filters | |
$scope.filters = {}; | |
// Search | |
$scope.lookup = function() { |
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
Factory.define :application do |factory| | |
factory.attachment(:sample, "public/samples/sample.doc", "application/msword") | |
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
14:55:23 < anathematic> mark[oz]: I don't believe in work | |
14:55:34 < anathematic> <3<3<3<3<3<3<3 cucumber | |
14:55:40 < anathematic> if someone is mastubating about me allow me to help | |
14:55:58 < mark[oz]> masturbating? | |
14:56:06 < anathematic> typo++ | |
14:56:11 < mark[oz]> wtf | |
14:56:13 < mark[oz]> lol | |
14:56:23 < mrkris> hhahahahhahahahaha |
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
<link rel="canonical" href="http://www.yoursite.com/path/to/article" /> |
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 Admin::PagesController < InheritedResources::Base | |
actions :all | |
def update | |
update! do |success, failure| | |
failure.html { redirect_to root_url } | |
end | |
end | |
protected |
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
rescue_from ActionController::RoutingError, :with => :page_not_found | |
private | |
def page_not_found | |
activate_authlogic | |
@possible = Title.find_tagged_with(request.request_uri.split('/'), :on => :tags, :limit => 5) | |
render :template => "shared/page_not_found", :status => :not_found | |
end |
NewerOlder