Permalink
Browse files

fixing episode 196 and adding episode 344

  • Loading branch information...
1 parent 5949a38 commit aa2b63fc128a54c52435012cc80c1b587aeffc66 @ryanb committed Apr 19, 2012
Showing with 2,190 additions and 0 deletions.
  1. 0 episode-196/revised/{mailer-before → questionnaire-after}/.gitignore
  2. +38 −0 episode-196/revised/questionnaire-after/Gemfile
  3. +111 −0 episode-196/revised/questionnaire-after/Gemfile.lock
  4. +9 −0 episode-196/revised/questionnaire-after/README.rdoc
  5. +7 −0 episode-196/revised/questionnaire-after/Rakefile
  6. BIN episode-196/revised/{mailer-before → questionnaire-after}/app/assets/images/rails.png
  7. 0 episode-196/revised/{mailer-before → questionnaire-after}/app/assets/javascripts/application.js
  8. +14 −0 episode-196/revised/questionnaire-after/app/assets/javascripts/surveys.js.coffee
  9. +93 −0 episode-196/revised/questionnaire-after/app/assets/stylesheets/application.css
  10. +51 −0 episode-196/revised/questionnaire-after/app/assets/stylesheets/surveys.css.scss
  11. 0 episode-196/revised/{mailer-before → questionnaire-after}/app/controllers/application_controller.rb
  12. +41 −0 episode-196/revised/questionnaire-after/app/controllers/surveys_controller.rb
  13. +10 −0 episode-196/revised/questionnaire-after/app/helpers/application_helper.rb
  14. +2 −0 episode-196/revised/questionnaire-after/app/helpers/surveys_helper.rb
  15. 0 episode-196/revised/{mailer-before/vendor/plugins → questionnaire-after/app/mailers}/.gitkeep
  16. 0 ...e-196/revised/{mailer-before/vendor/assets/stylesheets → questionnaire-after/app/models}/.gitkeep
  17. +4 −0 episode-196/revised/questionnaire-after/app/models/answer.rb
  18. +6 −0 episode-196/revised/questionnaire-after/app/models/question.rb
  19. +5 −0 episode-196/revised/questionnaire-after/app/models/survey.rb
  20. +17 −0 episode-196/revised/questionnaire-after/app/views/layouts/application.html.erb
  21. +6 −0 episode-196/revised/questionnaire-after/app/views/surveys/_answer_fields.html.erb
  22. +26 −0 episode-196/revised/questionnaire-after/app/views/surveys/_form.html.erb
  23. +10 −0 episode-196/revised/questionnaire-after/app/views/surveys/_question_fields.html.erb
  24. +3 −0 episode-196/revised/questionnaire-after/app/views/surveys/edit.html.erb
  25. +10 −0 episode-196/revised/questionnaire-after/app/views/surveys/index.html.erb
  26. +3 −0 episode-196/revised/questionnaire-after/app/views/surveys/new.html.erb
  27. +17 −0 episode-196/revised/questionnaire-after/app/views/surveys/show.html.erb
  28. +4 −0 episode-196/revised/questionnaire-after/config.ru
  29. +59 −0 episode-196/revised/questionnaire-after/config/application.rb
  30. 0 episode-196/revised/{mailer-before → questionnaire-after}/config/boot.rb
  31. +25 −0 episode-196/revised/questionnaire-after/config/database.yml
  32. +5 −0 episode-196/revised/questionnaire-after/config/environment.rb
  33. +37 −0 episode-196/revised/questionnaire-after/config/environments/development.rb
  34. +67 −0 episode-196/revised/questionnaire-after/config/environments/production.rb
  35. +37 −0 episode-196/revised/questionnaire-after/config/environments/test.rb
  36. 0 episode-196/revised/{mailer-before → questionnaire-after}/config/initializers/backtrace_silencers.rb
  37. 0 episode-196/revised/{mailer-before → questionnaire-after}/config/initializers/inflections.rb
  38. 0 episode-196/revised/{mailer-before → questionnaire-after}/config/initializers/mime_types.rb
  39. +7 −0 episode-196/revised/questionnaire-after/config/initializers/secret_token.rb
  40. +8 −0 episode-196/revised/questionnaire-after/config/initializers/session_store.rb
  41. 0 episode-196/revised/{mailer-before → questionnaire-after}/config/initializers/wrap_parameters.rb
  42. 0 episode-196/revised/{mailer-before → questionnaire-after}/config/locales/en.yml
  43. +4 −0 episode-196/revised/questionnaire-after/config/routes.rb
  44. +9 −0 episode-196/revised/questionnaire-after/db/migrate/20120417221609_create_surveys.rb
  45. +10 −0 episode-196/revised/questionnaire-after/db/migrate/20120417221626_create_questions.rb
  46. +10 −0 episode-196/revised/questionnaire-after/db/migrate/20120417221635_create_answers.rb
  47. +36 −0 episode-196/revised/questionnaire-after/db/schema.rb
  48. +26 −0 episode-196/revised/questionnaire-after/db/seeds.rb
  49. 0 episode-196/revised/{mailer-before → questionnaire-after}/doc/README_FOR_APP
  50. 0 ...e-196/revised/{mailer-before/vendor/assets/javascripts → questionnaire-after/lib/assets}/.gitkeep
  51. 0 episode-196/revised/{mailer-before/test/unit → questionnaire-after/lib/tasks}/.gitkeep
  52. 0 episode-196/revised/{mailer-before/test/integration → questionnaire-after/log}/.gitkeep
  53. 0 episode-196/revised/{mailer-before → questionnaire-after}/public/404.html
  54. 0 episode-196/revised/{mailer-before → questionnaire-after}/public/422.html
  55. 0 episode-196/revised/{mailer-before → questionnaire-after}/public/500.html
  56. 0 episode-196/revised/{mailer-before → questionnaire-after}/public/favicon.ico
  57. 0 episode-196/revised/{mailer-before → questionnaire-after}/public/robots.txt
  58. 0 episode-196/revised/{mailer-before → questionnaire-after}/script/rails
  59. 0 episode-196/revised/{mailer-before/test/functional → questionnaire-after/test/fixtures}/.gitkeep
  60. +9 −0 episode-196/revised/questionnaire-after/test/fixtures/answers.yml
  61. +9 −0 episode-196/revised/questionnaire-after/test/fixtures/questions.yml
  62. +7 −0 episode-196/revised/questionnaire-after/test/fixtures/surveys.yml
  63. 0 episode-196/revised/{mailer-before/test/fixtures → questionnaire-after/test/functional}/.gitkeep
  64. +49 −0 episode-196/revised/questionnaire-after/test/functional/surveys_controller_test.rb
  65. 0 episode-196/revised/{mailer-before/log → questionnaire-after/test/integration}/.gitkeep
  66. 0 episode-196/revised/{mailer-before → questionnaire-after}/test/performance/browsing_test.rb
  67. 0 episode-196/revised/{mailer-before → questionnaire-after}/test/test_helper.rb
  68. 0 episode-196/revised/{mailer-before/lib/tasks → questionnaire-after/test/unit}/.gitkeep
  69. +7 −0 episode-196/revised/questionnaire-after/test/unit/answer_test.rb
  70. +4 −0 episode-196/revised/questionnaire-after/test/unit/helpers/surveys_helper_test.rb
  71. +7 −0 episode-196/revised/questionnaire-after/test/unit/question_test.rb
  72. +7 −0 episode-196/revised/questionnaire-after/test/unit/survey_test.rb
  73. 0 ...e-196/revised/{mailer-before/lib/assets → questionnaire-after/vendor/assets/javascripts}/.gitkeep
  74. 0 ...e-196/revised/{mailer-before/app/models → questionnaire-after/vendor/assets/stylesheets}/.gitkeep
  75. 0 episode-196/revised/{mailer-before/app/mailers → questionnaire-after/vendor/plugins}/.gitkeep
  76. 0 episode-196/revised/{mailer-after → questionnaire-before}/.gitignore
  77. +38 −0 episode-196/revised/questionnaire-before/Gemfile
  78. +111 −0 episode-196/revised/questionnaire-before/Gemfile.lock
  79. +9 −0 episode-196/revised/questionnaire-before/README.rdoc
  80. +7 −0 episode-196/revised/questionnaire-before/Rakefile
  81. BIN episode-196/revised/{mailer-after → questionnaire-before}/app/assets/images/rails.png
  82. 0 episode-196/revised/{mailer-after → questionnaire-before}/app/assets/javascripts/application.js
  83. 0 ...avascripts/newsletters.js.coffee → questionnaire-before/app/assets/javascripts/surveys.js.coffee}
  84. +93 −0 episode-196/revised/questionnaire-before/app/assets/stylesheets/application.css
  85. +32 −0 episode-196/revised/questionnaire-before/app/assets/stylesheets/surveys.css.scss
  86. 0 episode-196/revised/{mailer-after → questionnaire-before}/app/controllers/application_controller.rb
  87. +41 −0 episode-196/revised/questionnaire-before/app/controllers/surveys_controller.rb
  88. 0 episode-196/revised/{mailer-before → questionnaire-before}/app/helpers/application_helper.rb
  89. +2 −0 episode-196/revised/questionnaire-before/app/helpers/surveys_helper.rb
  90. 0 episode-196/revised/{mailer-after/vendor/plugins → questionnaire-before/app/mailers}/.gitkeep
  91. 0 ...e-196/revised/{mailer-after/vendor/assets/stylesheets → questionnaire-before/app/models}/.gitkeep
  92. +4 −0 episode-196/revised/questionnaire-before/app/models/answer.rb
  93. +5 −0 episode-196/revised/questionnaire-before/app/models/question.rb
  94. +4 −0 episode-196/revised/questionnaire-before/app/models/survey.rb
  95. +17 −0 episode-196/revised/questionnaire-before/app/views/layouts/application.html.erb
  96. +20 −0 episode-196/revised/questionnaire-before/app/views/surveys/_form.html.erb
  97. +3 −0 episode-196/revised/questionnaire-before/app/views/surveys/edit.html.erb
  98. +10 −0 episode-196/revised/questionnaire-before/app/views/surveys/index.html.erb
  99. +3 −0 episode-196/revised/questionnaire-before/app/views/surveys/new.html.erb
  100. +17 −0 episode-196/revised/questionnaire-before/app/views/surveys/show.html.erb
  101. +4 −0 episode-196/revised/questionnaire-before/config.ru
  102. +59 −0 episode-196/revised/questionnaire-before/config/application.rb
  103. 0 episode-196/revised/{mailer-after → questionnaire-before}/config/boot.rb
  104. +25 −0 episode-196/revised/questionnaire-before/config/database.yml
  105. +5 −0 episode-196/revised/questionnaire-before/config/environment.rb
  106. +37 −0 episode-196/revised/questionnaire-before/config/environments/development.rb
  107. +67 −0 episode-196/revised/questionnaire-before/config/environments/production.rb
  108. +37 −0 episode-196/revised/questionnaire-before/config/environments/test.rb
  109. 0 episode-196/revised/{mailer-after → questionnaire-before}/config/initializers/backtrace_silencers.rb
  110. 0 episode-196/revised/{mailer-after → questionnaire-before}/config/initializers/inflections.rb
  111. 0 episode-196/revised/{mailer-after → questionnaire-before}/config/initializers/mime_types.rb
  112. +7 −0 episode-196/revised/questionnaire-before/config/initializers/secret_token.rb
  113. +8 −0 episode-196/revised/questionnaire-before/config/initializers/session_store.rb
  114. 0 episode-196/revised/{mailer-after → questionnaire-before}/config/initializers/wrap_parameters.rb
  115. 0 episode-196/revised/{mailer-after → questionnaire-before}/config/locales/en.yml
  116. +4 −0 episode-196/revised/questionnaire-before/config/routes.rb
  117. +9 −0 episode-196/revised/questionnaire-before/db/migrate/20120417221609_create_surveys.rb
  118. +10 −0 episode-196/revised/questionnaire-before/db/migrate/20120417221626_create_questions.rb
  119. +10 −0 episode-196/revised/questionnaire-before/db/migrate/20120417221635_create_answers.rb
  120. +36 −0 episode-196/revised/questionnaire-before/db/schema.rb
  121. +26 −0 episode-196/revised/questionnaire-before/db/seeds.rb
  122. 0 episode-196/revised/{mailer-after → questionnaire-before}/doc/README_FOR_APP
  123. 0 ...e-196/revised/{mailer-after/vendor/assets/javascripts → questionnaire-before/lib/assets}/.gitkeep
  124. 0 episode-196/revised/{mailer-after/test/unit → questionnaire-before/lib/tasks}/.gitkeep
  125. 0 episode-196/revised/{mailer-after/test/integration → questionnaire-before/log}/.gitkeep
  126. 0 episode-196/revised/{mailer-after → questionnaire-before}/public/404.html
  127. 0 episode-196/revised/{mailer-after → questionnaire-before}/public/422.html
  128. 0 episode-196/revised/{mailer-after → questionnaire-before}/public/500.html
  129. 0 episode-196/revised/{mailer-after → questionnaire-before}/public/favicon.ico
  130. 0 episode-196/revised/{mailer-after → questionnaire-before}/public/robots.txt
  131. 0 episode-196/revised/{mailer-after → questionnaire-before}/script/rails
  132. 0 episode-196/revised/{mailer-after/test/functional → questionnaire-before/test/fixtures}/.gitkeep
  133. +9 −0 episode-196/revised/questionnaire-before/test/fixtures/answers.yml
  134. +9 −0 episode-196/revised/questionnaire-before/test/fixtures/questions.yml
  135. +7 −0 episode-196/revised/questionnaire-before/test/fixtures/surveys.yml
  136. 0 episode-196/revised/{mailer-after/test/fixtures → questionnaire-before/test/functional}/.gitkeep
  137. +49 −0 episode-196/revised/questionnaire-before/test/functional/surveys_controller_test.rb
  138. 0 episode-196/revised/{mailer-after/log → questionnaire-before/test/integration}/.gitkeep
  139. 0 episode-196/revised/{mailer-after → questionnaire-before}/test/performance/browsing_test.rb
  140. 0 episode-196/revised/{mailer-after → questionnaire-before}/test/test_helper.rb
  141. 0 episode-196/revised/{mailer-after/lib/tasks → questionnaire-before/test/unit}/.gitkeep
  142. +7 −0 episode-196/revised/questionnaire-before/test/unit/answer_test.rb
  143. +4 −0 episode-196/revised/questionnaire-before/test/unit/helpers/surveys_helper_test.rb
  144. +7 −0 episode-196/revised/questionnaire-before/test/unit/question_test.rb
  145. +7 −0 episode-196/revised/questionnaire-before/test/unit/survey_test.rb
  146. 0 ...e-196/revised/{mailer-after/lib/assets → questionnaire-before/vendor/assets/javascripts}/.gitkeep
  147. 0 ...e-196/revised/{mailer-after/app/models → questionnaire-before/vendor/assets/stylesheets}/.gitkeep
  148. 0 episode-196/revised/{mailer-after/app/mailers → questionnaire-before/vendor/plugins}/.gitkeep
  149. +15 −0 episode-344/mailer-after/.gitignore
  150. 0 {episode-196/revised → episode-344}/mailer-after/Gemfile
  151. 0 {episode-196/revised → episode-344}/mailer-after/Gemfile.lock
  152. 0 {episode-196/revised → episode-344}/mailer-after/README.rdoc
  153. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/Rakefile
  154. BIN episode-344/mailer-after/app/assets/images/rails.png
  155. +15 −0 episode-344/mailer-after/app/assets/javascripts/application.js
  156. 0 {episode-196/revised → episode-344}/mailer-after/app/assets/javascripts/newsletters.js.coffee
  157. 0 ...sode-196/revised/mailer-before → episode-344/mailer-after}/app/assets/stylesheets/application.css
  158. 0 ...196/revised/mailer-before → episode-344/mailer-after}/app/assets/stylesheets/newsletters.css.scss
  159. +3 −0 episode-344/mailer-after/app/controllers/application_controller.rb
  160. 0 {episode-196/revised → episode-344}/mailer-after/app/controllers/newsletters_controller.rb
  161. 0 {episode-196/revised → episode-344}/mailer-after/app/helpers/application_helper.rb
  162. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/app/helpers/newsletters_helper.rb
  163. 0 episode-344/mailer-after/app/mailers/.gitkeep
  164. 0 episode-344/mailer-after/app/models/.gitkeep
  165. 0 {episode-196/revised → episode-344}/mailer-after/app/models/newsletter.rb
  166. 0 ...sode-196/revised/mailer-before → episode-344/mailer-after}/app/views/layouts/application.html.erb
  167. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/app/views/newsletters/index.html.erb
  168. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/config.ru
  169. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/config/application.rb
  170. +6 −0 episode-344/mailer-after/config/boot.rb
  171. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/config/database.yml
  172. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/config/environment.rb
  173. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/config/environments/development.rb
  174. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/config/environments/production.rb
  175. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/config/environments/test.rb
  176. +7 −0 episode-344/mailer-after/config/initializers/backtrace_silencers.rb
  177. +15 −0 episode-344/mailer-after/config/initializers/inflections.rb
  178. +5 −0 episode-344/mailer-after/config/initializers/mime_types.rb
  179. 0 {episode-196/revised → episode-344}/mailer-after/config/initializers/queue_classic.rb
  180. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/config/initializers/secret_token.rb
  181. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/config/initializers/session_store.rb
  182. +14 −0 episode-344/mailer-after/config/initializers/wrap_parameters.rb
  183. +5 −0 episode-344/mailer-after/config/locales/en.yml
  184. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/config/routes.rb
  185. 0 ...revised/mailer-before → episode-344/mailer-after}/db/migrate/20120418194819_create_newsletters.rb
  186. 0 {episode-196/revised → episode-344}/mailer-after/db/migrate/20120418213929_add_queue_classic.rb
  187. 0 {episode-196/revised → episode-344}/mailer-after/db/migrate/20120418213940_setup_queue_classic.rb
  188. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/db/seeds.rb
  189. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/db/structure.sql
  190. +2 −0 episode-344/mailer-after/doc/README_FOR_APP
  191. 0 episode-344/mailer-after/lib/assets/.gitkeep
  192. 0 episode-344/mailer-after/lib/tasks/.gitkeep
  193. 0 {episode-196/revised → episode-344}/mailer-after/lib/tasks/queue_classic.rake
  194. 0 episode-344/mailer-after/log/.gitkeep
  195. +26 −0 episode-344/mailer-after/public/404.html
  196. +26 −0 episode-344/mailer-after/public/422.html
  197. +25 −0 episode-344/mailer-after/public/500.html
  198. 0 episode-344/mailer-after/public/favicon.ico
  199. +5 −0 episode-344/mailer-after/public/robots.txt
  200. +6 −0 episode-344/mailer-after/script/rails
  201. 0 episode-344/mailer-after/test/fixtures/.gitkeep
  202. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/test/fixtures/newsletters.yml
  203. 0 episode-344/mailer-after/test/functional/.gitkeep
  204. 0 .../revised/mailer-before → episode-344/mailer-after}/test/functional/newsletters_controller_test.rb
  205. 0 episode-344/mailer-after/test/integration/.gitkeep
  206. +12 −0 episode-344/mailer-after/test/performance/browsing_test.rb
  207. +13 −0 episode-344/mailer-after/test/test_helper.rb
  208. 0 episode-344/mailer-after/test/unit/.gitkeep
  209. 0 ...96/revised/mailer-before → episode-344/mailer-after}/test/unit/helpers/newsletters_helper_test.rb
  210. 0 {episode-196/revised/mailer-before → episode-344/mailer-after}/test/unit/newsletter_test.rb
  211. 0 episode-344/mailer-after/vendor/assets/javascripts/.gitkeep
  212. 0 episode-344/mailer-after/vendor/assets/stylesheets/.gitkeep
  213. 0 episode-344/mailer-after/vendor/plugins/.gitkeep
  214. +15 −0 episode-344/mailer-before/.gitignore
  215. 0 {episode-196/revised → episode-344}/mailer-before/Gemfile
  216. 0 {episode-196/revised → episode-344}/mailer-before/Gemfile.lock
  217. 0 {episode-196/revised → episode-344}/mailer-before/README.rdoc
  218. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/Rakefile
  219. BIN episode-344/mailer-before/app/assets/images/rails.png
  220. +15 −0 episode-344/mailer-before/app/assets/javascripts/application.js
  221. +3 −0 episode-344/mailer-before/app/assets/javascripts/newsletters.js.coffee
  222. 0 ...sode-196/revised/mailer-after → episode-344/mailer-before}/app/assets/stylesheets/application.css
  223. 0 ...196/revised/mailer-after → episode-344/mailer-before}/app/assets/stylesheets/newsletters.css.scss
  224. +3 −0 episode-344/mailer-before/app/controllers/application_controller.rb
  225. 0 {episode-196/revised → episode-344}/mailer-before/app/controllers/newsletters_controller.rb
  226. +2 −0 episode-344/mailer-before/app/helpers/application_helper.rb
  227. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/app/helpers/newsletters_helper.rb
  228. 0 episode-344/mailer-before/app/mailers/.gitkeep
  229. 0 episode-344/mailer-before/app/models/.gitkeep
  230. 0 {episode-196/revised → episode-344}/mailer-before/app/models/newsletter.rb
  231. 0 ...sode-196/revised/mailer-after → episode-344/mailer-before}/app/views/layouts/application.html.erb
  232. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/app/views/newsletters/index.html.erb
  233. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/config.ru
  234. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/config/application.rb
  235. +6 −0 episode-344/mailer-before/config/boot.rb
  236. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/config/database.yml
  237. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/config/environment.rb
  238. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/config/environments/development.rb
  239. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/config/environments/production.rb
  240. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/config/environments/test.rb
  241. +7 −0 episode-344/mailer-before/config/initializers/backtrace_silencers.rb
  242. +15 −0 episode-344/mailer-before/config/initializers/inflections.rb
  243. +5 −0 episode-344/mailer-before/config/initializers/mime_types.rb
  244. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/config/initializers/secret_token.rb
  245. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/config/initializers/session_store.rb
  246. +14 −0 episode-344/mailer-before/config/initializers/wrap_parameters.rb
  247. +5 −0 episode-344/mailer-before/config/locales/en.yml
  248. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/config/routes.rb
  249. 0 ...revised/mailer-after → episode-344/mailer-before}/db/migrate/20120418194819_create_newsletters.rb
  250. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/db/seeds.rb
  251. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/db/structure.sql
  252. +2 −0 episode-344/mailer-before/doc/README_FOR_APP
  253. 0 episode-344/mailer-before/lib/assets/.gitkeep
  254. 0 episode-344/mailer-before/lib/tasks/.gitkeep
  255. 0 episode-344/mailer-before/log/.gitkeep
  256. +26 −0 episode-344/mailer-before/public/404.html
  257. +26 −0 episode-344/mailer-before/public/422.html
  258. +25 −0 episode-344/mailer-before/public/500.html
  259. 0 episode-344/mailer-before/public/favicon.ico
  260. +5 −0 episode-344/mailer-before/public/robots.txt
  261. +6 −0 episode-344/mailer-before/script/rails
  262. 0 episode-344/mailer-before/test/fixtures/.gitkeep
  263. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/test/fixtures/newsletters.yml
  264. 0 episode-344/mailer-before/test/functional/.gitkeep
  265. 0 .../revised/mailer-after → episode-344/mailer-before}/test/functional/newsletters_controller_test.rb
  266. 0 episode-344/mailer-before/test/integration/.gitkeep
  267. +12 −0 episode-344/mailer-before/test/performance/browsing_test.rb
  268. +13 −0 episode-344/mailer-before/test/test_helper.rb
  269. 0 episode-344/mailer-before/test/unit/.gitkeep
  270. 0 ...96/revised/mailer-after → episode-344/mailer-before}/test/unit/helpers/newsletters_helper_test.rb
  271. 0 {episode-196/revised/mailer-after → episode-344/mailer-before}/test/unit/newsletter_test.rb
  272. 0 episode-344/mailer-before/vendor/assets/javascripts/.gitkeep
  273. 0 episode-344/mailer-before/vendor/assets/stylesheets/.gitkeep
  274. 0 episode-344/mailer-before/vendor/plugins/.gitkeep
@@ -0,0 +1,38 @@
+source 'https://rubygems.org'
+
+gem 'rails', '3.2.3'
+
+# 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.2.3'
+ gem 'coffee-rails', '~> 3.2.1'
+
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
+ # gem 'therubyracer', :platform => :ruby
+
+ gem 'uglifier', '>= 1.0.3'
+end
+
+gem 'jquery-rails'
+
+# To use ActiveModel has_secure_password
+# gem 'bcrypt-ruby', '~> 3.0.0'
+
+# To use Jbuilder templates for JSON
+# gem 'jbuilder'
+
+# Use unicorn as the app server
+# gem 'unicorn'
+
+# Deploy with Capistrano
+# gem 'capistrano'
+
+# To use debugger
+# gem 'ruby-debug19', :require => 'ruby-debug'
@@ -0,0 +1,111 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ actionmailer (3.2.3)
+ actionpack (= 3.2.3)
+ mail (~> 2.4.4)
+ actionpack (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ builder (~> 3.0.0)
+ erubis (~> 2.7.0)
+ journey (~> 1.0.1)
+ rack (~> 1.4.0)
+ rack-cache (~> 1.2)
+ rack-test (~> 0.6.1)
+ sprockets (~> 2.1.2)
+ activemodel (3.2.3)
+ activesupport (= 3.2.3)
+ builder (~> 3.0.0)
+ activerecord (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ arel (~> 3.0.2)
+ tzinfo (~> 0.3.29)
+ activeresource (3.2.3)
+ activemodel (= 3.2.3)
+ activesupport (= 3.2.3)
+ activesupport (3.2.3)
+ i18n (~> 0.6)
+ multi_json (~> 1.0)
+ arel (3.0.2)
+ builder (3.0.0)
+ coffee-rails (3.2.2)
+ coffee-script (>= 2.2.0)
+ railties (~> 3.2.0)
+ coffee-script (2.2.0)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.3.1)
+ erubis (2.7.0)
+ execjs (1.3.0)
+ multi_json (~> 1.0)
+ hike (1.2.1)
+ i18n (0.6.0)
+ journey (1.0.3)
+ jquery-rails (2.0.2)
+ railties (>= 3.2.0, < 5.0)
+ thor (~> 0.14)
+ json (1.6.6)
+ mail (2.4.4)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.18)
+ multi_json (1.3.2)
+ polyglot (0.3.3)
+ rack (1.4.1)
+ rack-cache (1.2)
+ rack (>= 0.4)
+ rack-ssl (1.3.2)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rails (3.2.3)
+ actionmailer (= 3.2.3)
+ actionpack (= 3.2.3)
+ activerecord (= 3.2.3)
+ activeresource (= 3.2.3)
+ activesupport (= 3.2.3)
+ bundler (~> 1.0)
+ railties (= 3.2.3)
+ railties (3.2.3)
+ actionpack (= 3.2.3)
+ activesupport (= 3.2.3)
+ rack-ssl (~> 1.3.2)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (~> 0.14.6)
+ rake (0.9.2.2)
+ rdoc (3.12)
+ json (~> 1.4)
+ sass (3.1.15)
+ sass-rails (3.2.5)
+ railties (~> 3.2.0)
+ sass (>= 3.1.10)
+ tilt (~> 1.3)
+ sprockets (2.1.2)
+ hike (~> 1.2)
+ rack (~> 1.0)
+ tilt (~> 1.1, != 1.3.0)
+ sqlite3 (1.3.6)
+ thor (0.14.6)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.33)
+ uglifier (1.2.4)
+ execjs (>= 0.3.0)
+ multi_json (>= 1.0.2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ coffee-rails (~> 3.2.1)
+ jquery-rails
+ rails (= 3.2.3)
+ sass-rails (~> 3.2.3)
+ sqlite3
+ uglifier (>= 1.0.3)
@@ -0,0 +1,9 @@
+= RailsCasts Example Application
+
+Run these commands to try it out.
+
+ bundle
+ rake db:setup
+ rails s
+
+Requires Ruby 1.9.2 or later to run.
@@ -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__)
+
+Questionnaire::Application.load_tasks
@@ -0,0 +1,14 @@
+# 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/
+jQuery ->
+ $('form').on 'click', '.remove_fields', (event) ->
+ $(this).prev('input[type=hidden]').val('1')
+ $(this).closest('fieldset').hide()
+ event.preventDefault()
+
+ $('form').on 'click', '.add_fields', (event) ->
+ time = new Date().getTime()
+ regexp = new RegExp($(this).data('id'), 'g')
+ $(this).before($(this).data('fields').replace(regexp, time))
+ event.preventDefault()
@@ -0,0 +1,93 @@
+/*
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * 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;
+}
+
+.field_with_errors {
+ 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-bottom: 0;
+}
+
+form .field, form .actions {
+ margin: 12px 0;
+}
@@ -0,0 +1,51 @@
+// Place all the styles related to the surveys controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
+.article {
+ h2 {
+ font-size: 18px;
+ margin-top: 20px;
+ margin-bottom: 3px;
+ }
+}
+
+.questions {
+ list-style: none;
+ font-weight: bold;
+ margin: 0;
+ padding: 0;
+ > li {
+ margin: 20px 0;
+ padding: 0;
+ }
+}
+
+.answers {
+ list-style: upper-alpha;
+ font-weight: normal;
+ margin: 0;
+ padding: 0;
+ > li {
+ margin: 5px 0;
+ margin-left: 25px;
+ }
+}
+
+form > fieldset {
+ border: none;
+ border: solid 1px #CCC;
+ padding: 10px 15px;
+ margin: 15px 0;
+ fieldset {
+ border: none;
+ margin: 0;
+ margin: 10px 0;
+ padding: 0;
+ }
+}
+
+textarea {
+ height: 40px;
+ width: 350px;
+ margin-top: 3px;
+}
@@ -0,0 +1,41 @@
+class SurveysController < ApplicationController
+ def index
+ @surveys = Survey.all
+ end
+
+ def show
+ @survey = Survey.find(params[:id])
+ end
+
+ def new
+ @survey = Survey.new
+ end
+
+ def create
+ @survey = Survey.new(params[:survey])
+ if @survey.save
+ redirect_to @survey, notice: "Successfully created survey."
+ else
+ render :new
+ end
+ end
+
+ def edit
+ @survey = Survey.find(params[:id])
+ end
+
+ def update
+ @survey = Survey.find(params[:id])
+ if @survey.update_attributes(params[:survey])
+ redirect_to @survey, notice: "Successfully updated survey."
+ else
+ render :edit
+ end
+ end
+
+ def destroy
+ @survey = Survey.find(params[:id])
+ @survey.destroy
+ redirect_to surveys_url, notice: "Successfully destroyed survey."
+ end
+end
@@ -0,0 +1,10 @@
+module ApplicationHelper
+ def link_to_add_fields(name, f, association)
+ new_object = f.object.send(association).klass.new
+ id = new_object.object_id
+ fields = f.fields_for(association, new_object, child_index: id) do |builder|
+ render(association.to_s.singularize + "_fields", f: builder)
+ end
+ link_to(name, '#', class: "add_fields", data: {id: id, fields: fields.gsub("\n", "")})
+ end
+end
@@ -0,0 +1,2 @@
+module SurveysHelper
+end
@@ -0,0 +1,4 @@
+class Answer < ActiveRecord::Base
+ attr_accessible :content, :question_id
+ belongs_to :question
+end
@@ -0,0 +1,6 @@
+class Question < ActiveRecord::Base
+ attr_accessible :content, :survey_id, :answers_attributes
+ belongs_to :survey
+ has_many :answers
+ accepts_nested_attributes_for :answers, allow_destroy: true
+end
Oops, something went wrong. Retry.

0 comments on commit aa2b63f

Please sign in to comment.