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
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' | |
gem 'arel', github: 'rails/arel' | |
gem 'rack', github: 'rack/rack' | |
gem 'i18n', github: 'svenfuchs/i18n' | |
GEMFILE | |
system 'bundle' |
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
gem 'rails', '4.1.5' | |
require 'rails' | |
require 'action_controller/railtie' | |
require 'byebug' | |
class TestApp < Rails::Application | |
config.root = File.dirname(__FILE__) | |
config.session_store :cookie_store, key: 'cookie_store_key' |
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
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', path: '~/code/rails' | |
gem 'arel', github: 'rails/arel' | |
gem 'rack', github: 'rack/rack' | |
gem 'i18n', github: 'svenfuchs/i18n' | |
GEMFILE | |
system 'bundle' |
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
$ RAILS_ENV=test rake [ruby-1.9.3-p194@tissue] | |
Run options: | |
# Running tests: | |
.. | |
Finished tests in 0.391038s, 5.1146 tests/s, 12.7865 assertions/s. | |
2 tests, 5 assertions, 0 failures, 0 errors, 0 skips |
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
#import <Cocoa/Cocoa.h> | |
@interface CFlatUserInterface : NSObject { | |
NSViewController* _controller; | |
} | |
@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
<!doctype html> | |
<html> | |
<head> | |
<style> | |
body { | |
font-family: Helvetica Neue, Helvetica, Arial, sans-serif; | |
color: #242424; | |
} | |
h1 { |
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
fontName = "Menlo" | |
fontSize = 11 | |
include = "{*,.*}" | |
#includeFiles = "" | |
#includeDirectories = "" | |
#includeInBrowser = "" | |
#includeInFileChooser = "" | |
#includeFilesInBrowser = "" | |
#includeDirectoriesInBrowser = "" |
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 ApplicationController < ActionController::Base | |
before_filter do |c| | |
expire_page | |
end | |
after_filter do |c| | |
cache_page(nil, nil, false) | |
end | |
def method_missing(method) | |
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
# item.rb | |
class Item < ActiveRecord::Base | |
has_and_belongs_to_many :tags | |
accepts_nested_attributes_for :tags | |
attr_accessible :tags_json | |
def tags_json | |
logger.info(self.tags) | |
self.tags.map(&:attributes).to_json | |
end | |
def tags_json=(tokens) |
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
# config/router.rb | |
scope "/admin", :defaults => { :admin => true }, :as => "admin" do | |
authenticate(:user) do | |
resources :users, :as => 'users' | |
resources :menu_items, :as => 'menu', :path => 'menu' | |
root :to => 'menu_items#index' | |
end | |
end |
NewerOlder