Permalink
Browse files

adding episode 279

  • Loading branch information...
1 parent 5a2cbdd commit 86c32540e911117451b4d9980187164ed52fda8b @ryanb committed Aug 14, 2011
Showing with 2,350 additions and 0 deletions.
  1. +9 −0 episode-279/README
  2. +5 −0 episode-279/store-after/.gitignore
  3. +1 −0 episode-279/store-after/.rvmrc
  4. +33 −0 episode-279/store-after/Gemfile
  5. +120 −0 episode-279/store-after/Gemfile.lock
  6. +7 −0 episode-279/store-after/README
  7. +7 −0 episode-279/store-after/Rakefile
  8. +1 −0 episode-279/store-after/app/assets/anything/greeting.txt.erb
  9. BIN episode-279/store-after/app/assets/images/rails.png
  10. +1 −0 episode-279/store-after/app/assets/javascripts/admin/categories.js.coffee
  11. +10 −0 episode-279/store-after/app/assets/javascripts/application.js
  12. +3 −0 episode-279/store-after/app/assets/javascripts/public/home.js.coffee
  13. +3 −0 episode-279/store-after/app/assets/javascripts/public/products.js.coffee
  14. +121 −0 episode-279/store-after/app/assets/stylesheets/application.css
  15. +5 −0 episode-279/store-after/app/assets/stylesheets/categories.css.scss
  16. +5 −0 episode-279/store-after/app/assets/stylesheets/home.css.scss
  17. +9 −0 episode-279/store-after/app/assets/stylesheets/products.css.scss
  18. +3 −0 episode-279/store-after/app/controllers/application_controller.rb
  19. +5 −0 episode-279/store-after/app/controllers/home_controller.rb
  20. +9 −0 episode-279/store-after/app/controllers/products_controller.rb
  21. +2 −0 episode-279/store-after/app/helpers/application_helper.rb
  22. +2 −0 episode-279/store-after/app/helpers/home_helper.rb
  23. +2 −0 episode-279/store-after/app/helpers/products_helper.rb
  24. 0 episode-279/store-after/app/mailers/.gitkeep
  25. 0 episode-279/store-after/app/models/.gitkeep
  26. +3 −0 episode-279/store-after/app/models/category.rb
  27. +3 −0 episode-279/store-after/app/models/product.rb
  28. +5 −0 episode-279/store-after/app/views/home/index.html.erb
  29. +21 −0 episode-279/store-after/app/views/layouts/application.html.erb
  30. +8 −0 episode-279/store-after/app/views/products/index.html.erb
  31. +6 −0 episode-279/store-after/app/views/products/show.html.erb
  32. +4 −0 episode-279/store-after/config.ru
  33. +43 −0 episode-279/store-after/config/application.rb
  34. +6 −0 episode-279/store-after/config/boot.rb
  35. +25 −0 episode-279/store-after/config/database.yml
  36. +5 −0 episode-279/store-after/config/environment.rb
  37. +27 −0 episode-279/store-after/config/environments/development.rb
  38. +51 −0 episode-279/store-after/config/environments/production.rb
  39. +39 −0 episode-279/store-after/config/environments/test.rb
  40. +7 −0 episode-279/store-after/config/initializers/backtrace_silencers.rb
  41. +10 −0 episode-279/store-after/config/initializers/inflections.rb
  42. +5 −0 episode-279/store-after/config/initializers/mime_types.rb
  43. +7 −0 episode-279/store-after/config/initializers/secret_token.rb
  44. +8 −0 episode-279/store-after/config/initializers/session_store.rb
  45. +12 −0 episode-279/store-after/config/initializers/wrap_parameters.rb
  46. +5 −0 episode-279/store-after/config/locales/en.yml
  47. +4 −0 episode-279/store-after/config/routes.rb
  48. +10 −0 episode-279/store-after/db/migrate/20110604170646_create_products.rb
  49. +9 −0 episode-279/store-after/db/migrate/20110604214709_create_categories.rb
  50. +29 −0 episode-279/store-after/db/schema.rb
  51. +7 −0 episode-279/store-after/db/seeds.rb
  52. +2 −0 episode-279/store-after/doc/README_FOR_APP
  53. 0 episode-279/store-after/lib/assets/.gitkeep
  54. 0 episode-279/store-after/lib/tasks/.gitkeep
  55. 0 episode-279/store-after/log/.gitkeep
  56. +26 −0 episode-279/store-after/public/404.html
  57. +26 −0 episode-279/store-after/public/422.html
  58. +26 −0 episode-279/store-after/public/500.html
  59. +25 −0 episode-279/store-after/public/assets/application-0517d71d2eeb50b9b7d80ac30fa251d6.js
  60. BIN episode-279/store-after/public/assets/application-0517d71d2eeb50b9b7d80ac30fa251d6.js.gz
  61. +141 −0 episode-279/store-after/public/assets/application-a10d4455e2508db8e129882fba8e27f7.css
  62. BIN episode-279/store-after/public/assets/application-a10d4455e2508db8e129882fba8e27f7.css.gz
  63. +1 −0 episode-279/store-after/public/assets/greeting-c1d8a78349155a161a8ce51057f1a4f8.txt
  64. BIN episode-279/store-after/public/assets/greeting-c1d8a78349155a161a8ce51057f1a4f8.txt.gz
  65. +19 −0 episode-279/store-after/public/assets/jquery-de14911bcadd8115bd8b892053802605.min.js
  66. BIN episode-279/store-after/public/assets/jquery-de14911bcadd8115bd8b892053802605.min.js.gz
  67. +413 −0 episode-279/store-after/public/assets/jquery-ui-23e25c3cb76556b90e1c6dff65229d2a.min.js
  68. BIN episode-279/store-after/public/assets/jquery-ui-23e25c3cb76556b90e1c6dff65229d2a.min.js.gz
  69. BIN episode-279/store-after/public/assets/rails-3a12914cf0efeca3bf40fc90e189a0b9.png
  70. 0 episode-279/store-after/public/favicon.ico
  71. +5 −0 episode-279/store-after/public/robots.txt
  72. +6 −0 episode-279/store-after/script/rails
  73. 0 episode-279/store-after/test/fixtures/.gitkeep
  74. +7 −0 episode-279/store-after/test/fixtures/categories.yml
  75. +9 −0 episode-279/store-after/test/fixtures/products.yml
  76. 0 episode-279/store-after/test/functional/.gitkeep
  77. 0 episode-279/store-after/test/integration/.gitkeep
  78. +12 −0 episode-279/store-after/test/performance/browsing_test.rb
  79. +13 −0 episode-279/store-after/test/test_helper.rb
  80. 0 episode-279/store-after/test/unit/.gitkeep
  81. +7 −0 episode-279/store-after/test/unit/category_test.rb
  82. +4 −0 episode-279/store-after/test/unit/helpers/categories_helper_test.rb
  83. +4 −0 episode-279/store-after/test/unit/helpers/home_helper_test.rb
  84. +4 −0 episode-279/store-after/test/unit/helpers/products_helper_test.rb
  85. +7 −0 episode-279/store-after/test/unit/product_test.rb
  86. 0 episode-279/store-after/vendor/assets/stylesheets/.gitkeep
  87. 0 episode-279/store-after/vendor/plugins/.gitkeep
  88. +5 −0 episode-279/store-before/.gitignore
  89. +1 −0 episode-279/store-before/.rvmrc
  90. +33 −0 episode-279/store-before/Gemfile
  91. +120 −0 episode-279/store-before/Gemfile.lock
  92. +7 −0 episode-279/store-before/README
  93. +7 −0 episode-279/store-before/Rakefile
  94. BIN episode-279/store-before/app/assets/images/rails.png
  95. +9 −0 episode-279/store-before/app/assets/javascripts/application.js
  96. +3 −0 episode-279/store-before/app/assets/javascripts/categories.js.coffee
  97. +3 −0 episode-279/store-before/app/assets/javascripts/home.js.coffee
  98. +3 −0 episode-279/store-before/app/assets/javascripts/products.js.coffee
  99. +121 −0 episode-279/store-before/app/assets/stylesheets/application.css
  100. +5 −0 episode-279/store-before/app/assets/stylesheets/categories.css.scss
  101. +5 −0 episode-279/store-before/app/assets/stylesheets/home.css.scss
  102. +9 −0 episode-279/store-before/app/assets/stylesheets/products.css.scss
  103. +3 −0 episode-279/store-before/app/controllers/application_controller.rb
  104. +5 −0 episode-279/store-before/app/controllers/home_controller.rb
  105. +9 −0 episode-279/store-before/app/controllers/products_controller.rb
  106. +2 −0 episode-279/store-before/app/helpers/application_helper.rb
  107. +2 −0 episode-279/store-before/app/helpers/home_helper.rb
  108. +2 −0 episode-279/store-before/app/helpers/products_helper.rb
  109. 0 episode-279/store-before/app/mailers/.gitkeep
  110. 0 episode-279/store-before/app/models/.gitkeep
  111. +3 −0 episode-279/store-before/app/models/category.rb
  112. +3 −0 episode-279/store-before/app/models/product.rb
  113. +5 −0 episode-279/store-before/app/views/home/index.html.erb
  114. +21 −0 episode-279/store-before/app/views/layouts/application.html.erb
  115. +8 −0 episode-279/store-before/app/views/products/index.html.erb
  116. +6 −0 episode-279/store-before/app/views/products/show.html.erb
  117. +4 −0 episode-279/store-before/config.ru
  118. +43 −0 episode-279/store-before/config/application.rb
  119. +6 −0 episode-279/store-before/config/boot.rb
  120. +25 −0 episode-279/store-before/config/database.yml
  121. +5 −0 episode-279/store-before/config/environment.rb
  122. +27 −0 episode-279/store-before/config/environments/development.rb
  123. +51 −0 episode-279/store-before/config/environments/production.rb
  124. +39 −0 episode-279/store-before/config/environments/test.rb
  125. +7 −0 episode-279/store-before/config/initializers/backtrace_silencers.rb
  126. +10 −0 episode-279/store-before/config/initializers/inflections.rb
  127. +5 −0 episode-279/store-before/config/initializers/mime_types.rb
  128. +7 −0 episode-279/store-before/config/initializers/secret_token.rb
  129. +8 −0 episode-279/store-before/config/initializers/session_store.rb
  130. +12 −0 episode-279/store-before/config/initializers/wrap_parameters.rb
  131. +5 −0 episode-279/store-before/config/locales/en.yml
  132. +4 −0 episode-279/store-before/config/routes.rb
  133. +10 −0 episode-279/store-before/db/migrate/20110604170646_create_products.rb
  134. +9 −0 episode-279/store-before/db/migrate/20110604214709_create_categories.rb
  135. +29 −0 episode-279/store-before/db/schema.rb
  136. +7 −0 episode-279/store-before/db/seeds.rb
  137. +2 −0 episode-279/store-before/doc/README_FOR_APP
  138. 0 episode-279/store-before/lib/assets/.gitkeep
  139. 0 episode-279/store-before/lib/tasks/.gitkeep
  140. 0 episode-279/store-before/log/.gitkeep
  141. +26 −0 episode-279/store-before/public/404.html
  142. +26 −0 episode-279/store-before/public/422.html
  143. +26 −0 episode-279/store-before/public/500.html
  144. 0 episode-279/store-before/public/favicon.ico
  145. +5 −0 episode-279/store-before/public/robots.txt
  146. +6 −0 episode-279/store-before/script/rails
  147. 0 episode-279/store-before/test/fixtures/.gitkeep
  148. +7 −0 episode-279/store-before/test/fixtures/categories.yml
  149. +9 −0 episode-279/store-before/test/fixtures/products.yml
  150. 0 episode-279/store-before/test/functional/.gitkeep
  151. 0 episode-279/store-before/test/integration/.gitkeep
  152. +12 −0 episode-279/store-before/test/performance/browsing_test.rb
  153. +13 −0 episode-279/store-before/test/test_helper.rb
  154. 0 episode-279/store-before/test/unit/.gitkeep
  155. +7 −0 episode-279/store-before/test/unit/category_test.rb
  156. +4 −0 episode-279/store-before/test/unit/helpers/categories_helper_test.rb
  157. +4 −0 episode-279/store-before/test/unit/helpers/home_helper_test.rb
  158. +4 −0 episode-279/store-before/test/unit/helpers/products_helper_test.rb
  159. +7 −0 episode-279/store-before/test/unit/product_test.rb
  160. 0 episode-279/store-before/vendor/assets/stylesheets/.gitkeep
  161. 0 episode-279/store-before/vendor/plugins/.gitkeep
View
@@ -0,0 +1,9 @@
+RailsCasts Episode #279 Understanding the Asset Pipeline
+
+http://railscasts.com/episodes/279-understanding-the-asset-pipeline
+
+Commands used in episode
+
+ bundle open jquery-rails
+ rails s -e production
+ rake assets:precompile
@@ -0,0 +1,5 @@
+.bundle
+db/*.sqlite3
+log/*.log
+tmp/
+.sass-cache/
@@ -0,0 +1 @@
+rvm use 1.9.2@railspre --create
@@ -0,0 +1,33 @@
+source 'http://rubygems.org'
+
+gem 'rails', '3.1.0.rc5'
+
+# Bundle edge Rails instead:
+# gem 'rails', :git => 'git://github.com/rails/rails.git'
+
+gem 'sqlite3'
+
+
+# Gems used only for assets and not required
+# in production environments by default.
+group :assets do
+ gem 'sass-rails', "~> 3.1.0.rc"
+ gem 'coffee-rails', "~> 3.1.0.rc"
+ gem 'uglifier'
+end
+
+gem 'jquery-rails'
+
+# Use unicorn as the web server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'ruby-debug19', :require => 'ruby-debug'
+
+group :test do
+ # Pretty printed test output
+ gem 'turn', :require => false
+end
@@ -0,0 +1,120 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (3.1.0.rc5)
+ actionpack (= 3.1.0.rc5)
+ mail (~> 2.3.0)
+ actionpack (3.1.0.rc5)
+ activemodel (= 3.1.0.rc5)
+ activesupport (= 3.1.0.rc5)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ i18n (~> 0.6)
+ rack (~> 1.3.1)
+ rack-cache (~> 1.0.2)
+ rack-mount (~> 0.8.1)
+ rack-test (~> 0.6.0)
+ sprockets (~> 2.0.0.beta.12)
+ activemodel (3.1.0.rc5)
+ activesupport (= 3.1.0.rc5)
+ bcrypt-ruby (~> 2.1.4)
+ builder (~> 3.0.0)
+ i18n (~> 0.6)
+ activerecord (3.1.0.rc5)
+ activemodel (= 3.1.0.rc5)
+ activesupport (= 3.1.0.rc5)
+ arel (~> 2.1.4)
+ tzinfo (~> 0.3.29)
+ activeresource (3.1.0.rc5)
+ activemodel (= 3.1.0.rc5)
+ activesupport (= 3.1.0.rc5)
+ activesupport (3.1.0.rc5)
+ multi_json (~> 1.0)
+ ansi (1.3.0)
+ arel (2.1.4)
+ bcrypt-ruby (2.1.4)
+ builder (3.0.0)
+ coffee-rails (3.1.0.rc.5)
+ actionpack (~> 3.1.0.rc1)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.1.0.rc1)
+ sprockets (>= 2.0.0.beta.9)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.1.2)
+ erubis (2.7.0)
+ execjs (1.2.4)
+ multi_json (~> 1.0)
+ hike (1.2.0)
+ i18n (0.6.0)
+ jquery-rails (1.0.13)
+ railties (~> 3.0)
+ thor (~> 0.14)
+ mail (2.3.0)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.16)
+ multi_json (1.0.3)
+ polyglot (0.3.2)
+ rack (1.3.2)
+ rack-cache (1.0.2)
+ rack (>= 0.4)
+ rack-mount (0.8.2)
+ rack (>= 1.0.0)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.1.0.rc5)
+ actionmailer (= 3.1.0.rc5)
+ actionpack (= 3.1.0.rc5)
+ activerecord (= 3.1.0.rc5)
+ activeresource (= 3.1.0.rc5)
+ activesupport (= 3.1.0.rc5)
+ bundler (~> 1.0)
+ railties (= 3.1.0.rc5)
+ railties (3.1.0.rc5)
+ actionpack (= 3.1.0.rc5)
+ activesupport (= 3.1.0.rc5)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (~> 0.14.6)
+ rake (0.9.2)
+ rdoc (3.9.2)
+ sass (3.1.7)
+ sass-rails (3.1.0.rc.5)
+ actionpack (~> 3.1.0.rc1)
+ railties (~> 3.1.0.rc1)
+ sass (>= 3.1.4)
+ sprockets (>= 2.0.0.beta.9)
+ sprockets (2.0.0.beta.13)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (!= 1.3.0, ~> 1.1)
+ sqlite3 (1.3.4)
+ thor (0.14.6)
+ tilt (1.3.2)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ turn (0.8.2)
+ ansi (>= 1.2.2)
+ tzinfo (0.3.29)
+ uglifier (1.0.0)
+ execjs (>= 0.3.0)
+ multi_json (>= 1.0.2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ coffee-rails (~> 3.1.0.rc)
+ jquery-rails
+ rails (= 3.1.0.rc5)
+ sass-rails (~> 3.1.0.rc)
+ sqlite3
+ turn
+ uglifier
@@ -0,0 +1,7 @@
+= RailsCasts Example Application
+
+Run these commands to try it out.
+
+ bundle
+ rake db:migrate
+ rails s
@@ -0,0 +1,7 @@
+#!/usr/bin/env rake
+# Add your own tasks in files placed in lib/tasks ending in .rake,
+# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
+
+require File.expand_path('../config/application', __FILE__)
+
+Store::Application.load_tasks
@@ -0,0 +1 @@
+Hello world <%= 1 + 1 %>!
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,10 @@
+// This is a manifest file that'll be compiled into including all the files listed below.
+// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
+// be included in the compiled file accessible from http://example.com/assets/application.js
+// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
+// the compiled file.
+//
+//= require jquery
+//= require jquery_ujs
+//= require jquery-ui
+//= require_tree ./public
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,3 @@
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,121 @@
+/*
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
+ *= require_self
+ *= require_tree .
+*/
+
+html, body {
+ background-color: #4B7399;
+ font-family: Verdana, Helvetica, Arial;
+ font-size: 14px;
+}
+
+a img {
+ border: none;
+}
+
+a {
+ color: #0000FF;
+}
+
+.clear {
+ clear: both;
+ height: 0;
+ overflow: hidden;
+}
+
+#container {
+ width: 75%;
+ margin: 0 auto;
+ background-color: #FFF;
+ padding: 20px 40px;
+ border: solid 1px black;
+ margin-top: 20px;
+}
+
+#flash_notice, #flash_error, #flash_alert {
+ padding: 5px 8px;
+ margin: 10px 0;
+}
+
+#flash_notice {
+ background-color: #CFC;
+ border: solid 1px #6C6;
+}
+
+#flash_error, #flash_alert {
+ background-color: #FCC;
+ border: solid 1px #C66;
+}
+
+form label {
+ display: block;
+ margin-bottom: 2px;
+}
+
+form .field, form .actions {
+ margin: 12px 0;
+}
+
+.fieldWithErrors {
+ display: inline;
+}
+
+.error_messages {
+ width: 400px;
+ border: 2px solid #CF0000;
+ padding: 0px;
+ padding-bottom: 12px;
+ margin-bottom: 20px;
+ background-color: #f0f0f0;
+ font-size: 12px;
+}
+
+.error_messages h2 {
+ text-align: left;
+ font-weight: bold;
+ padding: 5px 10px;
+ font-size: 12px;
+ margin: 0;
+ background-color: #c00;
+ color: #fff;
+}
+
+.error_messages p {
+ margin: 8px 10px;
+}
+
+.error_messages ul {
+ margin: 0;
+}
+
+#side {
+ float: right;
+ border: solid 1px #777;
+ border-radius: 7px;
+ -moz-border-radius: 7px;
+ -webkit-border-radius: 7px;
+ padding: 10px 15px;
+ padding-right: 50px;
+ margin-left: 20px;
+}
+
+ul {
+ margin: 8px 0;
+ padding-left: 20px;
+}
+
+h1 {
+ margin-top: 0;
+}
+
+table.pretty {
+ border-collapse: collapse;
+}
+
+table.pretty td, table.pretty th {
+ padding: 5px 10px;
+ border: solid 1px #999;
+}
@@ -0,0 +1,5 @@
+/*
+ Place all the styles related to the matching controller here.
+ They will automatically be included in application.css.
+ You can use Sass (SCSS) here: http://sass-lang.com/
+*/
@@ -0,0 +1,5 @@
+/*
+ Place all the styles related to the matching controller here.
+ They will automatically be included in application.css.
+ You can use Sass (SCSS) here: http://sass-lang.com/
+*/
@@ -0,0 +1,9 @@
+.product {
+ margin: 20px 0;
+}
+
+.product a {
+ font-weight: bold;
+ font-size: 18px;
+ padding-right: 5px;
+}
@@ -0,0 +1,3 @@
+class ApplicationController < ActionController::Base
+ protect_from_forgery
+end
@@ -0,0 +1,5 @@
+class HomeController < ApplicationController
+ def index
+ end
+
+end
@@ -0,0 +1,9 @@
+class ProductsController < ApplicationController
+ def index
+ @products = Product.all
+ end
+
+ def show
+ @product = Product.find(params[:id])
+ end
+end
@@ -0,0 +1,2 @@
+module ApplicationHelper
+end
@@ -0,0 +1,2 @@
+module HomeHelper
+end
@@ -0,0 +1,2 @@
+module ProductsHelper
+end
@@ -0,0 +1,3 @@
+class Category < ActiveRecord::Base
+ has_many :products
+end
@@ -0,0 +1,3 @@
+class Product < ActiveRecord::Base
+ belongs_to :category
+end
Oops, something went wrong.

0 comments on commit 86c3254

Please sign in to comment.