jets 1.9.7 → 1.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1156) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +0 -6
  3. data/CHANGELOG.md +5 -0
  4. data/Rakefile +3 -0
  5. data/jets.gemspec +3 -2
  6. data/lib/jets.rb +5 -66
  7. data/lib/jets/application.rb +29 -112
  8. data/lib/jets/application/default_config.rb +95 -0
  9. data/lib/jets/autoloaders.rb +96 -0
  10. data/lib/jets/aws_services.rb +0 -4
  11. data/lib/jets/booter.rb +24 -127
  12. data/lib/jets/builders/code_builder.rb +1 -1
  13. data/lib/jets/builders/code_size.rb +1 -1
  14. data/lib/jets/builders/gem_replacer.rb +1 -1
  15. data/lib/jets/builders/handler_generator.rb +1 -1
  16. data/lib/jets/builders/lambda_layer.rb +1 -1
  17. data/lib/jets/builders/md5.rb +1 -1
  18. data/lib/jets/builders/md5_zip.rb +1 -1
  19. data/lib/jets/builders/purger.rb +1 -1
  20. data/lib/jets/builders/rack_packager.rb +1 -1
  21. data/lib/jets/builders/reconfigure_rails.rb +1 -1
  22. data/lib/jets/builders/ruby_packager.rb +1 -1
  23. data/lib/jets/builders/tidy.rb +1 -1
  24. data/lib/jets/builders/util.rb +1 -1
  25. data/lib/jets/bundle.rb +59 -0
  26. data/lib/jets/cfn/builders/api_deployment_builder.rb +1 -1
  27. data/lib/jets/cfn/builders/api_gateway_builder.rb +1 -1
  28. data/lib/jets/cfn/builders/base_child_builder.rb +1 -1
  29. data/lib/jets/cfn/builders/controller_builder.rb +1 -1
  30. data/lib/jets/cfn/builders/function_builder.rb +1 -1
  31. data/lib/jets/cfn/builders/interface.rb +1 -1
  32. data/lib/jets/cfn/builders/job_builder.rb +1 -1
  33. data/lib/jets/cfn/builders/parent_builder.rb +1 -1
  34. data/lib/jets/cfn/builders/rule_builder.rb +1 -1
  35. data/lib/jets/cfn/builders/shared_builder.rb +1 -1
  36. data/lib/jets/cfn/ship.rb +2 -6
  37. data/lib/jets/cfn/status.rb +1 -1
  38. data/lib/jets/cfn/upload.rb +1 -1
  39. data/lib/jets/cli.rb +39 -34
  40. data/lib/jets/commands/base.rb +12 -30
  41. data/lib/jets/commands/call.rb +0 -5
  42. data/lib/jets/commands/clean.rb +0 -4
  43. data/lib/jets/commands/console.rb +0 -1
  44. data/lib/jets/commands/db.rb +0 -2
  45. data/lib/jets/commands/dynamodb.rb +0 -3
  46. data/lib/jets/commands/help/call.md +3 -3
  47. data/lib/jets/commands/import.rb +1 -7
  48. data/lib/jets/commands/import/{rail.rb → rails.rb} +1 -1
  49. data/lib/jets/commands/main.rb +3 -1
  50. data/lib/jets/commands/new.rb +1 -1
  51. data/lib/jets/commands/rake_tasks.rb +2 -1
  52. data/lib/jets/commands/runner.rb +0 -2
  53. data/lib/jets/controller.rb +0 -14
  54. data/lib/jets/controller/base.rb +1 -1
  55. data/lib/jets/controller/cookies.rb +0 -2
  56. data/lib/jets/controller/middleware/local.rb +0 -4
  57. data/lib/jets/controller/rendering.rb +0 -1
  58. data/lib/jets/controller/rendering/rack_renderer.rb +1 -2
  59. data/lib/jets/core.rb +2 -7
  60. data/lib/jets/core_ext/kernel.rb +9 -52
  61. data/lib/jets/internal/app/jobs/jets/preheat_job.rb +8 -0
  62. data/lib/jets/{mailer.rb → internal/turbines/jets/mailer.rb} +0 -0
  63. data/lib/jets/job/base.rb +1 -3
  64. data/lib/jets/job/dsl.rb +0 -9
  65. data/lib/jets/logger.rb +0 -3
  66. data/lib/jets/mega/request.rb +0 -1
  67. data/lib/jets/middleware.rb +0 -5
  68. data/lib/jets/poly_fun.rb +0 -9
  69. data/lib/jets/resource.rb +0 -18
  70. data/lib/jets/resource/api_gateway/rest_api.rb +0 -4
  71. data/lib/jets/resource/api_gateway/rest_api/routes.rb +0 -4
  72. data/lib/jets/resource/api_gateway/rest_api/routes/change.rb +0 -4
  73. data/lib/jets/resource/api_gateway/rest_api/routes/collision.rb +0 -2
  74. data/lib/jets/resource/iot/topic_rule.rb +1 -1
  75. data/lib/jets/resource/lambda/function.rb +0 -1
  76. data/lib/jets/router.rb +0 -2
  77. data/lib/jets/rule/base.rb +1 -1
  78. data/lib/jets/spec_helpers.rb +1 -4
  79. data/lib/jets/stack.rb +1 -24
  80. data/lib/jets/stack/depends.rb +0 -2
  81. data/lib/jets/stack/main.rb +0 -1
  82. data/lib/jets/stack/main/dsl.rb +0 -7
  83. data/lib/jets/stack/main/{extensions → dsl}/base.rb +0 -0
  84. data/lib/jets/stack/main/{extensions → dsl}/cloudwatch.rb +0 -0
  85. data/lib/jets/stack/main/{extensions → dsl}/iam.rb +0 -0
  86. data/lib/jets/stack/main/{extensions → dsl}/lambda.rb +0 -0
  87. data/lib/jets/stack/main/{extensions → dsl}/s3.rb +0 -0
  88. data/lib/jets/stack/main/{extensions → dsl}/sns.rb +0 -0
  89. data/lib/jets/stack/main/{extensions → dsl}/sqs.rb +0 -0
  90. data/lib/jets/stack/output.rb +0 -3
  91. data/lib/jets/stack/parameter.rb +0 -1
  92. data/lib/jets/stack/resource.rb +0 -1
  93. data/lib/jets/turbo.rb +11 -4
  94. data/lib/jets/turbo/{rail.rb → rails.rb} +1 -1
  95. data/lib/jets/version.rb +1 -1
  96. metadata +58 -1075
  97. data/lib/jets/builders.rb +0 -16
  98. data/lib/jets/builders/shim_vars.rb +0 -5
  99. data/lib/jets/cfn.rb +0 -6
  100. data/lib/jets/cfn/builders.rb +0 -20
  101. data/lib/jets/commands.rb +0 -27
  102. data/lib/jets/commands/markdown.rb +0 -8
  103. data/lib/jets/controller/middleware.rb +0 -5
  104. data/lib/jets/controller/rack.rb +0 -5
  105. data/lib/jets/io.rb +0 -14
  106. data/lib/jets/job.rb +0 -4
  107. data/lib/jets/job/helpers.rb +0 -5
  108. data/lib/jets/lambda.rb +0 -18
  109. data/lib/jets/mega.rb +0 -7
  110. data/lib/jets/processors.rb +0 -4
  111. data/lib/jets/resource/api_gateway.rb +0 -9
  112. data/lib/jets/resource/api_gateway/base_path.rb +0 -5
  113. data/lib/jets/resource/child_stack.rb +0 -7
  114. data/lib/jets/resource/config.rb +0 -4
  115. data/lib/jets/resource/events.rb +0 -3
  116. data/lib/jets/resource/iam.rb +0 -8
  117. data/lib/jets/resource/iot.rb +0 -3
  118. data/lib/jets/resource/lambda.rb +0 -6
  119. data/lib/jets/resource/logs.rb +0 -3
  120. data/lib/jets/resource/route53.rb +0 -3
  121. data/lib/jets/resource/s3.rb +0 -3
  122. data/lib/jets/resource/sns.rb +0 -5
  123. data/lib/jets/resource/sqs.rb +0 -3
  124. data/lib/jets/rule.rb +0 -4
  125. data/vendor/jets-gems/Gemfile +0 -6
  126. data/vendor/jets-gems/LICENSE.txt +0 -21
  127. data/vendor/jets-gems/README.md +0 -19
  128. data/vendor/jets-gems/Rakefile +0 -6
  129. data/vendor/jets-gems/bin/console +0 -14
  130. data/vendor/jets-gems/bin/setup +0 -8
  131. data/vendor/jets-gems/jets-gems.gemspec +0 -30
  132. data/vendor/jets-gems/lib/jets-gems.rb +0 -1
  133. data/vendor/jets-gems/lib/jets/gems.rb +0 -17
  134. data/vendor/jets-gems/lib/jets/gems/agree.rb +0 -60
  135. data/vendor/jets-gems/lib/jets/gems/check.rb +0 -190
  136. data/vendor/jets-gems/lib/jets/gems/exist.rb +0 -56
  137. data/vendor/jets-gems/lib/jets/gems/extract.rb +0 -7
  138. data/vendor/jets-gems/lib/jets/gems/extract/base.rb +0 -74
  139. data/vendor/jets-gems/lib/jets/gems/extract/gem.rb +0 -105
  140. data/vendor/jets-gems/lib/jets/gems/extract/ruby.rb +0 -71
  141. data/vendor/jets-gems/lib/jets/gems/report.rb +0 -69
  142. data/vendor/jets-gems/lib/jets/gems/version.rb +0 -5
  143. data/vendor/jets-gems/spec/jets/gems_spec.rb +0 -5
  144. data/vendor/jets-gems/spec/spec_helper.rb +0 -14
  145. data/vendor/rails/Brewfile +0 -13
  146. data/vendor/rails/CODE_OF_CONDUCT.md +0 -12
  147. data/vendor/rails/CONTRIBUTING.md +0 -49
  148. data/vendor/rails/Gemfile +0 -174
  149. data/vendor/rails/MIT-LICENSE +0 -20
  150. data/vendor/rails/RAILS_VERSION +0 -1
  151. data/vendor/rails/README.md +0 -97
  152. data/vendor/rails/RELEASING_RAILS.md +0 -225
  153. data/vendor/rails/Rakefile +0 -72
  154. data/vendor/rails/actionpack/CHANGELOG.md +0 -407
  155. data/vendor/rails/actionpack/MIT-LICENSE +0 -21
  156. data/vendor/rails/actionpack/README.rdoc +0 -57
  157. data/vendor/rails/actionpack/Rakefile +0 -40
  158. data/vendor/rails/actionpack/actionpack.gemspec +0 -38
  159. data/vendor/rails/actionpack/bin/test +0 -5
  160. data/vendor/rails/actionpack/lib/abstract_controller.rb +0 -27
  161. data/vendor/rails/actionpack/lib/abstract_controller/asset_paths.rb +0 -12
  162. data/vendor/rails/actionpack/lib/abstract_controller/base.rb +0 -265
  163. data/vendor/rails/actionpack/lib/abstract_controller/caching.rb +0 -66
  164. data/vendor/rails/actionpack/lib/abstract_controller/caching/fragments.rb +0 -166
  165. data/vendor/rails/actionpack/lib/abstract_controller/callbacks.rb +0 -212
  166. data/vendor/rails/actionpack/lib/abstract_controller/collector.rb +0 -43
  167. data/vendor/rails/actionpack/lib/abstract_controller/error.rb +0 -6
  168. data/vendor/rails/actionpack/lib/abstract_controller/helpers.rb +0 -194
  169. data/vendor/rails/actionpack/lib/abstract_controller/logger.rb +0 -14
  170. data/vendor/rails/actionpack/lib/abstract_controller/railties/routes_helpers.rb +0 -20
  171. data/vendor/rails/actionpack/lib/abstract_controller/rendering.rb +0 -127
  172. data/vendor/rails/actionpack/lib/abstract_controller/translation.rb +0 -31
  173. data/vendor/rails/actionpack/lib/abstract_controller/url_for.rb +0 -35
  174. data/vendor/rails/actionpack/lib/action_controller.rb +0 -66
  175. data/vendor/rails/actionpack/lib/action_controller/api.rb +0 -149
  176. data/vendor/rails/actionpack/lib/action_controller/api/api_rendering.rb +0 -16
  177. data/vendor/rails/actionpack/lib/action_controller/base.rb +0 -276
  178. data/vendor/rails/actionpack/lib/action_controller/caching.rb +0 -46
  179. data/vendor/rails/actionpack/lib/action_controller/form_builder.rb +0 -50
  180. data/vendor/rails/actionpack/lib/action_controller/log_subscriber.rb +0 -78
  181. data/vendor/rails/actionpack/lib/action_controller/metal.rb +0 -256
  182. data/vendor/rails/actionpack/lib/action_controller/metal/basic_implicit_render.rb +0 -13
  183. data/vendor/rails/actionpack/lib/action_controller/metal/conditional_get.rb +0 -274
  184. data/vendor/rails/actionpack/lib/action_controller/metal/content_security_policy.rb +0 -52
  185. data/vendor/rails/actionpack/lib/action_controller/metal/cookies.rb +0 -16
  186. data/vendor/rails/actionpack/lib/action_controller/metal/data_streaming.rb +0 -152
  187. data/vendor/rails/actionpack/lib/action_controller/metal/etag_with_flash.rb +0 -18
  188. data/vendor/rails/actionpack/lib/action_controller/metal/etag_with_template_digest.rb +0 -57
  189. data/vendor/rails/actionpack/lib/action_controller/metal/exceptions.rb +0 -53
  190. data/vendor/rails/actionpack/lib/action_controller/metal/flash.rb +0 -61
  191. data/vendor/rails/actionpack/lib/action_controller/metal/force_ssl.rb +0 -99
  192. data/vendor/rails/actionpack/lib/action_controller/metal/head.rb +0 -60
  193. data/vendor/rails/actionpack/lib/action_controller/metal/helpers.rb +0 -123
  194. data/vendor/rails/actionpack/lib/action_controller/metal/http_authentication.rb +0 -519
  195. data/vendor/rails/actionpack/lib/action_controller/metal/implicit_render.rb +0 -73
  196. data/vendor/rails/actionpack/lib/action_controller/metal/instrumentation.rb +0 -107
  197. data/vendor/rails/actionpack/lib/action_controller/metal/live.rb +0 -312
  198. data/vendor/rails/actionpack/lib/action_controller/metal/mime_responds.rb +0 -313
  199. data/vendor/rails/actionpack/lib/action_controller/metal/parameter_encoding.rb +0 -51
  200. data/vendor/rails/actionpack/lib/action_controller/metal/params_wrapper.rb +0 -293
  201. data/vendor/rails/actionpack/lib/action_controller/metal/redirecting.rb +0 -133
  202. data/vendor/rails/actionpack/lib/action_controller/metal/renderers.rb +0 -181
  203. data/vendor/rails/actionpack/lib/action_controller/metal/rendering.rb +0 -122
  204. data/vendor/rails/actionpack/lib/action_controller/metal/request_forgery_protection.rb +0 -445
  205. data/vendor/rails/actionpack/lib/action_controller/metal/rescue.rb +0 -28
  206. data/vendor/rails/actionpack/lib/action_controller/metal/streaming.rb +0 -223
  207. data/vendor/rails/actionpack/lib/action_controller/metal/strong_parameters.rb +0 -1086
  208. data/vendor/rails/actionpack/lib/action_controller/metal/testing.rb +0 -16
  209. data/vendor/rails/actionpack/lib/action_controller/metal/url_for.rb +0 -58
  210. data/vendor/rails/actionpack/lib/action_controller/railtie.rb +0 -89
  211. data/vendor/rails/actionpack/lib/action_controller/railties/helpers.rb +0 -24
  212. data/vendor/rails/actionpack/lib/action_controller/renderer.rb +0 -117
  213. data/vendor/rails/actionpack/lib/action_controller/template_assertions.rb +0 -11
  214. data/vendor/rails/actionpack/lib/action_controller/test_case.rb +0 -629
  215. data/vendor/rails/actionpack/lib/action_dispatch.rb +0 -112
  216. data/vendor/rails/actionpack/lib/action_dispatch/http/cache.rb +0 -220
  217. data/vendor/rails/actionpack/lib/action_dispatch/http/content_security_policy.rb +0 -272
  218. data/vendor/rails/actionpack/lib/action_dispatch/http/filter_parameters.rb +0 -84
  219. data/vendor/rails/actionpack/lib/action_dispatch/http/filter_redirect.rb +0 -37
  220. data/vendor/rails/actionpack/lib/action_dispatch/http/headers.rb +0 -132
  221. data/vendor/rails/actionpack/lib/action_dispatch/http/mime_negotiation.rb +0 -170
  222. data/vendor/rails/actionpack/lib/action_dispatch/http/mime_type.rb +0 -342
  223. data/vendor/rails/actionpack/lib/action_dispatch/http/mime_types.rb +0 -50
  224. data/vendor/rails/actionpack/lib/action_dispatch/http/parameter_filter.rb +0 -86
  225. data/vendor/rails/actionpack/lib/action_dispatch/http/parameters.rb +0 -126
  226. data/vendor/rails/actionpack/lib/action_dispatch/http/rack_cache.rb +0 -63
  227. data/vendor/rails/actionpack/lib/action_dispatch/http/request.rb +0 -430
  228. data/vendor/rails/actionpack/lib/action_dispatch/http/response.rb +0 -520
  229. data/vendor/rails/actionpack/lib/action_dispatch/http/upload.rb +0 -84
  230. data/vendor/rails/actionpack/lib/action_dispatch/http/url.rb +0 -350
  231. data/vendor/rails/actionpack/lib/action_dispatch/journey.rb +0 -7
  232. data/vendor/rails/actionpack/lib/action_dispatch/journey/formatter.rb +0 -189
  233. data/vendor/rails/actionpack/lib/action_dispatch/journey/gtg/builder.rb +0 -164
  234. data/vendor/rails/actionpack/lib/action_dispatch/journey/gtg/simulator.rb +0 -41
  235. data/vendor/rails/actionpack/lib/action_dispatch/journey/gtg/transition_table.rb +0 -158
  236. data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/builder.rb +0 -78
  237. data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/dot.rb +0 -36
  238. data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/simulator.rb +0 -49
  239. data/vendor/rails/actionpack/lib/action_dispatch/journey/nfa/transition_table.rb +0 -120
  240. data/vendor/rails/actionpack/lib/action_dispatch/journey/nodes/node.rb +0 -140
  241. data/vendor/rails/actionpack/lib/action_dispatch/journey/parser.rb +0 -199
  242. data/vendor/rails/actionpack/lib/action_dispatch/journey/parser.y +0 -50
  243. data/vendor/rails/actionpack/lib/action_dispatch/journey/parser_extras.rb +0 -31
  244. data/vendor/rails/actionpack/lib/action_dispatch/journey/path/pattern.rb +0 -198
  245. data/vendor/rails/actionpack/lib/action_dispatch/journey/route.rb +0 -203
  246. data/vendor/rails/actionpack/lib/action_dispatch/journey/router.rb +0 -156
  247. data/vendor/rails/actionpack/lib/action_dispatch/journey/router/utils.rb +0 -102
  248. data/vendor/rails/actionpack/lib/action_dispatch/journey/routes.rb +0 -82
  249. data/vendor/rails/actionpack/lib/action_dispatch/journey/scanner.rb +0 -64
  250. data/vendor/rails/actionpack/lib/action_dispatch/journey/visitors.rb +0 -268
  251. data/vendor/rails/actionpack/lib/action_dispatch/journey/visualizer/fsm.css +0 -30
  252. data/vendor/rails/actionpack/lib/action_dispatch/journey/visualizer/fsm.js +0 -134
  253. data/vendor/rails/actionpack/lib/action_dispatch/journey/visualizer/index.html.erb +0 -52
  254. data/vendor/rails/actionpack/lib/action_dispatch/middleware/callbacks.rb +0 -36
  255. data/vendor/rails/actionpack/lib/action_dispatch/middleware/cookies.rb +0 -685
  256. data/vendor/rails/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb +0 -205
  257. data/vendor/rails/actionpack/lib/action_dispatch/middleware/debug_locks.rb +0 -124
  258. data/vendor/rails/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb +0 -147
  259. data/vendor/rails/actionpack/lib/action_dispatch/middleware/executor.rb +0 -21
  260. data/vendor/rails/actionpack/lib/action_dispatch/middleware/flash.rb +0 -300
  261. data/vendor/rails/actionpack/lib/action_dispatch/middleware/public_exceptions.rb +0 -57
  262. data/vendor/rails/actionpack/lib/action_dispatch/middleware/reloader.rb +0 -12
  263. data/vendor/rails/actionpack/lib/action_dispatch/middleware/remote_ip.rb +0 -183
  264. data/vendor/rails/actionpack/lib/action_dispatch/middleware/request_id.rb +0 -43
  265. data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb +0 -92
  266. data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/cache_store.rb +0 -54
  267. data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb +0 -117
  268. data/vendor/rails/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb +0 -28
  269. data/vendor/rails/actionpack/lib/action_dispatch/middleware/show_exceptions.rb +0 -62
  270. data/vendor/rails/actionpack/lib/action_dispatch/middleware/ssl.rb +0 -150
  271. data/vendor/rails/actionpack/lib/action_dispatch/middleware/stack.rb +0 -116
  272. data/vendor/rails/actionpack/lib/action_dispatch/middleware/static.rb +0 -130
  273. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +0 -22
  274. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb +0 -23
  275. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.html.erb +0 -27
  276. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_source.text.erb +0 -8
  277. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +0 -52
  278. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb +0 -9
  279. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +0 -16
  280. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb +0 -9
  281. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +0 -21
  282. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb +0 -13
  283. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/layout.erb +0 -161
  284. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +0 -11
  285. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.text.erb +0 -3
  286. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb +0 -32
  287. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.text.erb +0 -11
  288. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +0 -20
  289. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb +0 -7
  290. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb +0 -6
  291. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.text.erb +0 -3
  292. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/routes/_route.html.erb +0 -16
  293. data/vendor/rails/actionpack/lib/action_dispatch/middleware/templates/routes/_table.html.erb +0 -200
  294. data/vendor/rails/actionpack/lib/action_dispatch/railtie.rb +0 -55
  295. data/vendor/rails/actionpack/lib/action_dispatch/request/session.rb +0 -234
  296. data/vendor/rails/actionpack/lib/action_dispatch/request/utils.rb +0 -78
  297. data/vendor/rails/actionpack/lib/action_dispatch/routing.rb +0 -260
  298. data/vendor/rails/actionpack/lib/action_dispatch/routing/endpoint.rb +0 -17
  299. data/vendor/rails/actionpack/lib/action_dispatch/routing/inspector.rb +0 -225
  300. data/vendor/rails/actionpack/lib/action_dispatch/routing/mapper.rb +0 -2267
  301. data/vendor/rails/actionpack/lib/action_dispatch/routing/polymorphic_routes.rb +0 -352
  302. data/vendor/rails/actionpack/lib/action_dispatch/routing/redirection.rb +0 -201
  303. data/vendor/rails/actionpack/lib/action_dispatch/routing/route_set.rb +0 -890
  304. data/vendor/rails/actionpack/lib/action_dispatch/routing/routes_proxy.rb +0 -69
  305. data/vendor/rails/actionpack/lib/action_dispatch/routing/url_for.rb +0 -236
  306. data/vendor/rails/actionpack/lib/action_dispatch/system_test_case.rb +0 -147
  307. data/vendor/rails/actionpack/lib/action_dispatch/system_testing/browser.rb +0 -49
  308. data/vendor/rails/actionpack/lib/action_dispatch/system_testing/driver.rb +0 -59
  309. data/vendor/rails/actionpack/lib/action_dispatch/system_testing/server.rb +0 -31
  310. data/vendor/rails/actionpack/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +0 -96
  311. data/vendor/rails/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +0 -31
  312. data/vendor/rails/actionpack/lib/action_dispatch/system_testing/test_helpers/undef_methods.rb +0 -26
  313. data/vendor/rails/actionpack/lib/action_dispatch/testing/assertion_response.rb +0 -47
  314. data/vendor/rails/actionpack/lib/action_dispatch/testing/assertions.rb +0 -24
  315. data/vendor/rails/actionpack/lib/action_dispatch/testing/assertions/response.rb +0 -107
  316. data/vendor/rails/actionpack/lib/action_dispatch/testing/assertions/routing.rb +0 -222
  317. data/vendor/rails/actionpack/lib/action_dispatch/testing/integration.rb +0 -652
  318. data/vendor/rails/actionpack/lib/action_dispatch/testing/request_encoder.rb +0 -55
  319. data/vendor/rails/actionpack/lib/action_dispatch/testing/test_process.rb +0 -50
  320. data/vendor/rails/actionpack/lib/action_dispatch/testing/test_request.rb +0 -71
  321. data/vendor/rails/actionpack/lib/action_dispatch/testing/test_response.rb +0 -53
  322. data/vendor/rails/actionpack/lib/action_pack.rb +0 -26
  323. data/vendor/rails/actionpack/lib/action_pack/gem_version.rb +0 -17
  324. data/vendor/rails/actionpack/lib/action_pack/version.rb +0 -10
  325. data/vendor/rails/actionpack/test/abstract/callbacks_test.rb +0 -270
  326. data/vendor/rails/actionpack/test/abstract/collector_test.rb +0 -65
  327. data/vendor/rails/actionpack/test/abstract/translation_test.rb +0 -79
  328. data/vendor/rails/actionpack/test/abstract_unit.rb +0 -457
  329. data/vendor/rails/actionpack/test/assertions/response_assertions_test.rb +0 -141
  330. data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +0 -493
  331. data/vendor/rails/actionpack/test/controller/api/conditional_get_test.rb +0 -59
  332. data/vendor/rails/actionpack/test/controller/api/data_streaming_test.rb +0 -28
  333. data/vendor/rails/actionpack/test/controller/api/force_ssl_test.rb +0 -22
  334. data/vendor/rails/actionpack/test/controller/api/implicit_render_test.rb +0 -17
  335. data/vendor/rails/actionpack/test/controller/api/params_wrapper_test.rb +0 -28
  336. data/vendor/rails/actionpack/test/controller/api/redirect_to_test.rb +0 -21
  337. data/vendor/rails/actionpack/test/controller/api/renderers_test.rb +0 -50
  338. data/vendor/rails/actionpack/test/controller/api/url_for_test.rb +0 -22
  339. data/vendor/rails/actionpack/test/controller/api/with_cookies_test.rb +0 -23
  340. data/vendor/rails/actionpack/test/controller/api/with_helpers_test.rb +0 -44
  341. data/vendor/rails/actionpack/test/controller/base_test.rb +0 -323
  342. data/vendor/rails/actionpack/test/controller/caching_test.rb +0 -511
  343. data/vendor/rails/actionpack/test/controller/content_type_test.rb +0 -169
  344. data/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/admin/user_controller.rb +0 -0
  345. data/vendor/rails/actionpack/test/controller/controller_fixtures/app/controllers/user_controller.rb +0 -0
  346. data/vendor/rails/actionpack/test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb +0 -0
  347. data/vendor/rails/actionpack/test/controller/default_url_options_with_before_action_test.rb +0 -28
  348. data/vendor/rails/actionpack/test/controller/filters_test.rb +0 -1050
  349. data/vendor/rails/actionpack/test/controller/flash_hash_test.rb +0 -216
  350. data/vendor/rails/actionpack/test/controller/flash_test.rb +0 -373
  351. data/vendor/rails/actionpack/test/controller/force_ssl_test.rb +0 -333
  352. data/vendor/rails/actionpack/test/controller/form_builder_test.rb +0 -19
  353. data/vendor/rails/actionpack/test/controller/helper_test.rb +0 -295
  354. data/vendor/rails/actionpack/test/controller/http_basic_authentication_test.rb +0 -179
  355. data/vendor/rails/actionpack/test/controller/http_digest_authentication_test.rb +0 -282
  356. data/vendor/rails/actionpack/test/controller/http_token_authentication_test.rb +0 -216
  357. data/vendor/rails/actionpack/test/controller/integration_test.rb +0 -1136
  358. data/vendor/rails/actionpack/test/controller/live_stream_test.rb +0 -518
  359. data/vendor/rails/actionpack/test/controller/localized_templates_test.rb +0 -48
  360. data/vendor/rails/actionpack/test/controller/log_subscriber_test.rb +0 -371
  361. data/vendor/rails/actionpack/test/controller/metal/renderers_test.rb +0 -50
  362. data/vendor/rails/actionpack/test/controller/metal_test.rb +0 -32
  363. data/vendor/rails/actionpack/test/controller/mime/accept_format_test.rb +0 -94
  364. data/vendor/rails/actionpack/test/controller/mime/respond_to_test.rb +0 -843
  365. data/vendor/rails/actionpack/test/controller/new_base/bare_metal_test.rb +0 -184
  366. data/vendor/rails/actionpack/test/controller/new_base/base_test.rb +0 -131
  367. data/vendor/rails/actionpack/test/controller/new_base/content_negotiation_test.rb +0 -28
  368. data/vendor/rails/actionpack/test/controller/new_base/content_type_test.rb +0 -116
  369. data/vendor/rails/actionpack/test/controller/new_base/middleware_test.rb +0 -112
  370. data/vendor/rails/actionpack/test/controller/new_base/render_action_test.rb +0 -314
  371. data/vendor/rails/actionpack/test/controller/new_base/render_body_test.rb +0 -172
  372. data/vendor/rails/actionpack/test/controller/new_base/render_context_test.rb +0 -54
  373. data/vendor/rails/actionpack/test/controller/new_base/render_file_test.rb +0 -72
  374. data/vendor/rails/actionpack/test/controller/new_base/render_html_test.rb +0 -192
  375. data/vendor/rails/actionpack/test/controller/new_base/render_implicit_action_test.rb +0 -59
  376. data/vendor/rails/actionpack/test/controller/new_base/render_layout_test.rb +0 -128
  377. data/vendor/rails/actionpack/test/controller/new_base/render_partial_test.rb +0 -62
  378. data/vendor/rails/actionpack/test/controller/new_base/render_plain_test.rb +0 -170
  379. data/vendor/rails/actionpack/test/controller/new_base/render_streaming_test.rb +0 -116
  380. data/vendor/rails/actionpack/test/controller/new_base/render_template_test.rb +0 -240
  381. data/vendor/rails/actionpack/test/controller/new_base/render_test.rb +0 -142
  382. data/vendor/rails/actionpack/test/controller/new_base/render_xml_test.rb +0 -12
  383. data/vendor/rails/actionpack/test/controller/output_escaping_test.rb +0 -17
  384. data/vendor/rails/actionpack/test/controller/parameter_encoding_test.rb +0 -52
  385. data/vendor/rails/actionpack/test/controller/parameters/accessors_test.rb +0 -324
  386. data/vendor/rails/actionpack/test/controller/parameters/always_permitted_parameters_test.rb +0 -30
  387. data/vendor/rails/actionpack/test/controller/parameters/dup_test.rb +0 -67
  388. data/vendor/rails/actionpack/test/controller/parameters/log_on_unpermitted_params_test.rb +0 -70
  389. data/vendor/rails/actionpack/test/controller/parameters/multi_parameter_attributes_test.rb +0 -39
  390. data/vendor/rails/actionpack/test/controller/parameters/mutators_test.rb +0 -122
  391. data/vendor/rails/actionpack/test/controller/parameters/nested_parameters_permit_test.rb +0 -184
  392. data/vendor/rails/actionpack/test/controller/parameters/parameters_permit_test.rb +0 -516
  393. data/vendor/rails/actionpack/test/controller/parameters/raise_on_unpermitted_params_test.rb +0 -33
  394. data/vendor/rails/actionpack/test/controller/parameters/serialization_test.rb +0 -55
  395. data/vendor/rails/actionpack/test/controller/params_wrapper_test.rb +0 -422
  396. data/vendor/rails/actionpack/test/controller/permitted_params_test.rb +0 -27
  397. data/vendor/rails/actionpack/test/controller/redirect_test.rb +0 -395
  398. data/vendor/rails/actionpack/test/controller/render_js_test.rb +0 -36
  399. data/vendor/rails/actionpack/test/controller/render_json_test.rb +0 -137
  400. data/vendor/rails/actionpack/test/controller/render_test.rb +0 -843
  401. data/vendor/rails/actionpack/test/controller/render_xml_test.rb +0 -102
  402. data/vendor/rails/actionpack/test/controller/renderer_test.rb +0 -136
  403. data/vendor/rails/actionpack/test/controller/renderers_test.rb +0 -91
  404. data/vendor/rails/actionpack/test/controller/request/test_request_test.rb +0 -42
  405. data/vendor/rails/actionpack/test/controller/request_forgery_protection_test.rb +0 -1013
  406. data/vendor/rails/actionpack/test/controller/required_params_test.rb +0 -100
  407. data/vendor/rails/actionpack/test/controller/rescue_test.rb +0 -364
  408. data/vendor/rails/actionpack/test/controller/resources_test.rb +0 -1369
  409. data/vendor/rails/actionpack/test/controller/routing_test.rb +0 -2108
  410. data/vendor/rails/actionpack/test/controller/runner_test.rb +0 -24
  411. data/vendor/rails/actionpack/test/controller/send_file_test.rb +0 -259
  412. data/vendor/rails/actionpack/test/controller/show_exceptions_test.rb +0 -114
  413. data/vendor/rails/actionpack/test/controller/streaming_test.rb +0 -28
  414. data/vendor/rails/actionpack/test/controller/test_case_test.rb +0 -1157
  415. data/vendor/rails/actionpack/test/controller/url_for_integration_test.rb +0 -192
  416. data/vendor/rails/actionpack/test/controller/url_for_test.rb +0 -519
  417. data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +0 -92
  418. data/vendor/rails/actionpack/test/controller/webservice_test.rb +0 -135
  419. data/vendor/rails/actionpack/test/dispatch/callbacks_test.rb +0 -47
  420. data/vendor/rails/actionpack/test/dispatch/content_security_policy_test.rb +0 -525
  421. data/vendor/rails/actionpack/test/dispatch/cookies_test.rb +0 -1345
  422. data/vendor/rails/actionpack/test/dispatch/debug_exceptions_test.rb +0 -502
  423. data/vendor/rails/actionpack/test/dispatch/debug_locks_test.rb +0 -38
  424. data/vendor/rails/actionpack/test/dispatch/exception_wrapper_test.rb +0 -120
  425. data/vendor/rails/actionpack/test/dispatch/executor_test.rb +0 -136
  426. data/vendor/rails/actionpack/test/dispatch/header_test.rb +0 -169
  427. data/vendor/rails/actionpack/test/dispatch/live_response_test.rb +0 -98
  428. data/vendor/rails/actionpack/test/dispatch/mapper_test.rb +0 -210
  429. data/vendor/rails/actionpack/test/dispatch/middleware_stack_test.rb +0 -115
  430. data/vendor/rails/actionpack/test/dispatch/mime_type_test.rb +0 -187
  431. data/vendor/rails/actionpack/test/dispatch/mount_test.rb +0 -95
  432. data/vendor/rails/actionpack/test/dispatch/prefix_generation_test.rb +0 -463
  433. data/vendor/rails/actionpack/test/dispatch/rack_cache_test.rb +0 -23
  434. data/vendor/rails/actionpack/test/dispatch/reloader_test.rb +0 -167
  435. data/vendor/rails/actionpack/test/dispatch/request/json_params_parsing_test.rb +0 -207
  436. data/vendor/rails/actionpack/test/dispatch/request/multipart_params_parsing_test.rb +0 -202
  437. data/vendor/rails/actionpack/test/dispatch/request/query_string_parsing_test.rb +0 -176
  438. data/vendor/rails/actionpack/test/dispatch/request/session_test.rb +0 -165
  439. data/vendor/rails/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb +0 -181
  440. data/vendor/rails/actionpack/test/dispatch/request_id_test.rb +0 -75
  441. data/vendor/rails/actionpack/test/dispatch/request_test.rb +0 -1307
  442. data/vendor/rails/actionpack/test/dispatch/response_test.rb +0 -542
  443. data/vendor/rails/actionpack/test/dispatch/routing/concerns_test.rb +0 -124
  444. data/vendor/rails/actionpack/test/dispatch/routing/custom_url_helpers_test.rb +0 -333
  445. data/vendor/rails/actionpack/test/dispatch/routing/inspector_test.rb +0 -425
  446. data/vendor/rails/actionpack/test/dispatch/routing/ipv6_redirect_test.rb +0 -46
  447. data/vendor/rails/actionpack/test/dispatch/routing/route_set_test.rb +0 -166
  448. data/vendor/rails/actionpack/test/dispatch/routing_assertions_test.rb +0 -209
  449. data/vendor/rails/actionpack/test/dispatch/routing_test.rb +0 -5112
  450. data/vendor/rails/actionpack/test/dispatch/runner_test.rb +0 -19
  451. data/vendor/rails/actionpack/test/dispatch/session/abstract_store_test.rb +0 -58
  452. data/vendor/rails/actionpack/test/dispatch/session/cache_store_test.rb +0 -183
  453. data/vendor/rails/actionpack/test/dispatch/session/cookie_store_test.rb +0 -417
  454. data/vendor/rails/actionpack/test/dispatch/session/mem_cache_store_test.rb +0 -205
  455. data/vendor/rails/actionpack/test/dispatch/session/test_session_test.rb +0 -65
  456. data/vendor/rails/actionpack/test/dispatch/show_exceptions_test.rb +0 -138
  457. data/vendor/rails/actionpack/test/dispatch/ssl_test.rb +0 -228
  458. data/vendor/rails/actionpack/test/dispatch/static_test.rb +0 -318
  459. data/vendor/rails/actionpack/test/dispatch/system_testing/driver_test.rb +0 -54
  460. data/vendor/rails/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb +0 -81
  461. data/vendor/rails/actionpack/test/dispatch/system_testing/server_test.rb +0 -32
  462. data/vendor/rails/actionpack/test/dispatch/system_testing/system_test_case_test.rb +0 -84
  463. data/vendor/rails/actionpack/test/dispatch/test_request_test.rb +0 -131
  464. data/vendor/rails/actionpack/test/dispatch/test_response_test.rb +0 -37
  465. data/vendor/rails/actionpack/test/dispatch/uploaded_file_test.rb +0 -113
  466. data/vendor/rails/actionpack/test/dispatch/url_generation_test.rb +0 -141
  467. data/vendor/rails/actionpack/test/fixtures/_top_level_partial_only.erb +0 -1
  468. data/vendor/rails/actionpack/test/fixtures/alternate_helpers/foo_helper.rb +0 -5
  469. data/vendor/rails/actionpack/test/fixtures/bad_customers/_bad_customer.html.erb +0 -1
  470. data/vendor/rails/actionpack/test/fixtures/collection_cache/index.html.erb +0 -1
  471. data/vendor/rails/actionpack/test/fixtures/company.rb +0 -11
  472. data/vendor/rails/actionpack/test/fixtures/customers/_commented_customer.html.erb +0 -5
  473. data/vendor/rails/actionpack/test/fixtures/customers/_customer.html.erb +0 -4
  474. data/vendor/rails/actionpack/test/fixtures/filter_test/implicit_actions/edit.html.erb +0 -1
  475. data/vendor/rails/actionpack/test/fixtures/filter_test/implicit_actions/show.html.erb +0 -1
  476. data/vendor/rails/actionpack/test/fixtures/functional_caching/_formatted_partial.html.erb +0 -1
  477. data/vendor/rails/actionpack/test/fixtures/functional_caching/_partial.erb +0 -3
  478. data/vendor/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached.html.erb +0 -3
  479. data/vendor/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached.xml.builder +0 -5
  480. data/vendor/rails/actionpack/test/fixtures/functional_caching/formatted_fragment_cached_with_variant.html+phone.erb +0 -3
  481. data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached.html.erb +0 -3
  482. data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached_with_options.html.erb +0 -3
  483. data/vendor/rails/actionpack/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb +0 -3
  484. data/vendor/rails/actionpack/test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb +0 -1
  485. data/vendor/rails/actionpack/test/fixtures/functional_caching/inline_fragment_cached.html.erb +0 -2
  486. data/vendor/rails/actionpack/test/fixtures/functional_caching/xml_fragment_cached_with_html_partial.xml.builder +0 -5
  487. data/vendor/rails/actionpack/test/fixtures/helpers/abc_helper.rb +0 -5
  488. data/vendor/rails/actionpack/test/fixtures/helpers/fun/games_helper.rb +0 -7
  489. data/vendor/rails/actionpack/test/fixtures/helpers/fun/pdf_helper.rb +0 -7
  490. data/vendor/rails/actionpack/test/fixtures/helpers/just_me_helper.rb +0 -5
  491. data/vendor/rails/actionpack/test/fixtures/helpers/me_too_helper.rb +0 -5
  492. data/vendor/rails/actionpack/test/fixtures/helpers1_pack/pack1_helper.rb +0 -7
  493. data/vendor/rails/actionpack/test/fixtures/helpers2_pack/pack2_helper.rb +0 -7
  494. data/vendor/rails/actionpack/test/fixtures/helpers_typo/admin/users_helper.rb +0 -6
  495. data/vendor/rails/actionpack/test/fixtures/implicit_render_test/empty_action_with_mobile_variant.html+mobile.erb +0 -1
  496. data/vendor/rails/actionpack/test/fixtures/implicit_render_test/empty_action_with_template.html.erb +0 -1
  497. data/vendor/rails/actionpack/test/fixtures/layouts/_customers.erb +0 -1
  498. data/vendor/rails/actionpack/test/fixtures/layouts/block_with_layout.erb +0 -3
  499. data/vendor/rails/actionpack/test/fixtures/layouts/builder.builder +0 -3
  500. data/vendor/rails/actionpack/test/fixtures/layouts/partial_with_layout.erb +0 -3
  501. data/vendor/rails/actionpack/test/fixtures/layouts/standard.html.erb +0 -1
  502. data/vendor/rails/actionpack/test/fixtures/layouts/talk_from_action.erb +0 -2
  503. data/vendor/rails/actionpack/test/fixtures/layouts/with_html_partial.html.erb +0 -1
  504. data/vendor/rails/actionpack/test/fixtures/layouts/xhr.html.erb +0 -2
  505. data/vendor/rails/actionpack/test/fixtures/layouts/yield.erb +0 -2
  506. data/vendor/rails/actionpack/test/fixtures/load_me.rb +0 -4
  507. data/vendor/rails/actionpack/test/fixtures/localized/hello_world.de.html +0 -1
  508. data/vendor/rails/actionpack/test/fixtures/localized/hello_world.en.html +0 -1
  509. data/vendor/rails/actionpack/test/fixtures/localized/hello_world.it.erb +0 -1
  510. data/vendor/rails/actionpack/test/fixtures/multipart/binary_file +0 -0
  511. data/vendor/rails/actionpack/test/fixtures/multipart/boundary_problem_file +0 -10
  512. data/vendor/rails/actionpack/test/fixtures/multipart/bracketed_param +0 -5
  513. data/vendor/rails/actionpack/test/fixtures/multipart/bracketed_utf8_param +0 -5
  514. data/vendor/rails/actionpack/test/fixtures/multipart/empty +0 -10
  515. data/vendor/rails/actionpack/test/fixtures/multipart/hello.txt +0 -1
  516. data/vendor/rails/actionpack/test/fixtures/multipart/large_text_file +0 -10
  517. data/vendor/rails/actionpack/test/fixtures/multipart/mixed_files +0 -0
  518. data/vendor/rails/actionpack/test/fixtures/multipart/none +0 -9
  519. data/vendor/rails/actionpack/test/fixtures/multipart/ruby_on_rails.jpg +0 -0
  520. data/vendor/rails/actionpack/test/fixtures/multipart/single_parameter +0 -5
  521. data/vendor/rails/actionpack/test/fixtures/multipart/single_utf8_param +0 -5
  522. data/vendor/rails/actionpack/test/fixtures/multipart/text_file +0 -10
  523. data/vendor/rails/actionpack/test/fixtures/multipart/utf8_filename +0 -10
  524. data/vendor/rails/actionpack/test/fixtures/namespaced/implicit_render_test/hello_world.erb +0 -1
  525. data/vendor/rails/actionpack/test/fixtures/old_content_type/render_default_content_types_for_respond_to.xml.erb +0 -1
  526. data/vendor/rails/actionpack/test/fixtures/old_content_type/render_default_for_builder.builder +0 -1
  527. data/vendor/rails/actionpack/test/fixtures/old_content_type/render_default_for_erb.erb +0 -1
  528. data/vendor/rails/actionpack/test/fixtures/post_test/layouts/post.html.erb +0 -1
  529. data/vendor/rails/actionpack/test/fixtures/post_test/layouts/super_post.iphone.erb +0 -1
  530. data/vendor/rails/actionpack/test/fixtures/post_test/post/index.html.erb +0 -1
  531. data/vendor/rails/actionpack/test/fixtures/post_test/post/index.iphone.erb +0 -1
  532. data/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.html.erb +0 -1
  533. data/vendor/rails/actionpack/test/fixtures/post_test/super_post/index.iphone.erb +0 -1
  534. data/vendor/rails/actionpack/test/fixtures/public/400.html +0 -1
  535. data/vendor/rails/actionpack/test/fixtures/public/404.html +0 -1
  536. data/vendor/rails/actionpack/test/fixtures/public/500.da.html +0 -1
  537. data/vendor/rails/actionpack/test/fixtures/public/500.html +0 -1
  538. data/vendor/rails/actionpack/test/fixtures/public/bar.html +0 -1
  539. data/vendor/rails/actionpack/test/fixtures/public/bar/index.html +0 -1
  540. data/vendor/rails/actionpack/test/fixtures/public/foo/bar.html +0 -1
  541. data/vendor/rails/actionpack/test/fixtures/public/foo/baz.css +0 -3
  542. data/vendor/rails/actionpack/test/fixtures/public/foo/index.html +0 -1
  543. data/vendor/rails/actionpack/test/fixtures/public/foo/other-index.html +0 -1
  544. data/vendor/rails/actionpack/test/fixtures/public/foo//343/201/223/343/202/223/343/201/253/343/201/241/343/201/257.html +0 -1
  545. data/vendor/rails/actionpack/test/fixtures/public/foo//343/201/225/343/202/210/343/201/206/343/201/252/343/202/211.html +0 -1
  546. data/vendor/rails/actionpack/test/fixtures/public/foo//343/201/225/343/202/210/343/201/206/343/201/252/343/202/211.html.gz +0 -0
  547. data/vendor/rails/actionpack/test/fixtures/public/gzip/application-a71b3024f80aea3181c09774ca17e712.js +0 -4
  548. data/vendor/rails/actionpack/test/fixtures/public/gzip/application-a71b3024f80aea3181c09774ca17e712.js.gz +0 -0
  549. data/vendor/rails/actionpack/test/fixtures/public/gzip/foo.zoo +0 -4
  550. data/vendor/rails/actionpack/test/fixtures/public/gzip/foo.zoo.gz +0 -0
  551. data/vendor/rails/actionpack/test/fixtures/public/index.html +0 -1
  552. data/vendor/rails/actionpack/test/fixtures/public/other-index.html +0 -1
  553. data/vendor/rails/actionpack/test/fixtures/respond_to/all_types_with_layout.html.erb +0 -1
  554. data/vendor/rails/actionpack/test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb +0 -1
  555. data/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.html.erb +0 -1
  556. data/vendor/rails/actionpack/test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb +0 -1
  557. data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/missing.html.erb +0 -1
  558. data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.html.erb +0 -1
  559. data/vendor/rails/actionpack/test/fixtures/respond_to/layouts/standard.iphone.erb +0 -1
  560. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.html.erb +0 -1
  561. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults.xml.builder +0 -1
  562. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_all.html.erb +0 -1
  563. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.html.erb +0 -1
  564. data/vendor/rails/actionpack/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder +0 -1
  565. data/vendor/rails/actionpack/test/fixtures/respond_to/variant_any_implicit_render.html+phablet.erb +0 -1
  566. data/vendor/rails/actionpack/test/fixtures/respond_to/variant_any_implicit_render.html+tablet.erb +0 -1
  567. data/vendor/rails/actionpack/test/fixtures/respond_to/variant_inline_syntax_without_block.html+phone.erb +0 -1
  568. data/vendor/rails/actionpack/test/fixtures/respond_to/variant_plus_none_for_format.html.erb +0 -1
  569. data/vendor/rails/actionpack/test/fixtures/respond_to/variant_with_implicit_template_rendering.html+mobile.erb +0 -1
  570. data/vendor/rails/actionpack/test/fixtures/ruby_template.ruby +0 -2
  571. data/vendor/rails/actionpack/test/fixtures/session_autoload_test/session_autoload_test/foo.rb +0 -12
  572. data/vendor/rails/actionpack/test/fixtures/shared.html.erb +0 -1
  573. data/vendor/rails/actionpack/test/fixtures/star_star_mime/index.js.erb +0 -1
  574. data/vendor/rails/actionpack/test/fixtures/test/_partial.erb +0 -1
  575. data/vendor/rails/actionpack/test/fixtures/test/_partial.html.erb +0 -1
  576. data/vendor/rails/actionpack/test/fixtures/test/_partial.js.erb +0 -1
  577. data/vendor/rails/actionpack/test/fixtures/test/dot.directory/render_file_with_ivar.erb +0 -1
  578. data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.builder +0 -1
  579. data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.html.erb +0 -1
  580. data/vendor/rails/actionpack/test/fixtures/test/formatted_xml_erb.xml.erb +0 -1
  581. data/vendor/rails/actionpack/test/fixtures/test/hello/hello.erb +0 -1
  582. data/vendor/rails/actionpack/test/fixtures/test/hello_world.erb +0 -1
  583. data/vendor/rails/actionpack/test/fixtures/test/hello_world_with_partial.html.erb +0 -2
  584. data/vendor/rails/actionpack/test/fixtures/test/hello_xml_world.builder +0 -11
  585. data/vendor/rails/actionpack/test/fixtures/test/implicit_content_type.atom.builder +0 -2
  586. data/vendor/rails/actionpack/test/fixtures/test/render_file_with_ivar.erb +0 -1
  587. data/vendor/rails/actionpack/test/fixtures/test/render_file_with_locals.erb +0 -1
  588. data/vendor/rails/actionpack/test/fixtures/test/with_implicit_template.erb +0 -1
  589. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/bar.html +0 -1
  590. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/bar/index.html +0 -1
  591. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/bar.html +0 -1
  592. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/baz.css +0 -3
  593. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/index.html +0 -1
  594. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo/other-index.html +0 -1
  595. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo//343/201/223/343/202/223/343/201/253/343/201/241/343/201/257.html +0 -1
  596. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo//343/201/225/343/202/210/343/201/206/343/201/252/343/202/211.html +0 -1
  597. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/foo//343/201/225/343/202/210/343/201/206/343/201/252/343/202/211.html.gz +0 -0
  598. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/application-a71b3024f80aea3181c09774ca17e712.js +0 -4
  599. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/application-a71b3024f80aea3181c09774ca17e712.js.gz +0 -0
  600. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/foo.zoo +0 -4
  601. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/gzip/foo.zoo.gz +0 -0
  602. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/index.html +0 -1
  603. data/vendor/rails/actionpack/test/fixtures//345/205/254/345/205/261/other-index.html +0 -1
  604. data/vendor/rails/actionpack/test/journey/gtg/builder_test.rb +0 -81
  605. data/vendor/rails/actionpack/test/journey/gtg/transition_table_test.rb +0 -125
  606. data/vendor/rails/actionpack/test/journey/nfa/simulator_test.rb +0 -100
  607. data/vendor/rails/actionpack/test/journey/nfa/transition_table_test.rb +0 -74
  608. data/vendor/rails/actionpack/test/journey/nodes/symbol_test.rb +0 -19
  609. data/vendor/rails/actionpack/test/journey/path/pattern_test.rb +0 -286
  610. data/vendor/rails/actionpack/test/journey/route/definition/parser_test.rb +0 -112
  611. data/vendor/rails/actionpack/test/journey/route/definition/scanner_test.rb +0 -71
  612. data/vendor/rails/actionpack/test/journey/route_test.rb +0 -113
  613. data/vendor/rails/actionpack/test/journey/router/utils_test.rb +0 -48
  614. data/vendor/rails/actionpack/test/journey/router_test.rb +0 -544
  615. data/vendor/rails/actionpack/test/journey/routes_test.rb +0 -62
  616. data/vendor/rails/actionpack/test/lib/controller/fake_controllers.rb +0 -37
  617. data/vendor/rails/actionpack/test/lib/controller/fake_models.rb +0 -79
  618. data/vendor/rails/actionpack/test/routing/helper_test.rb +0 -33
  619. data/vendor/rails/actionview/CHANGELOG.md +0 -122
  620. data/vendor/rails/actionview/MIT-LICENSE +0 -21
  621. data/vendor/rails/actionview/README.rdoc +0 -38
  622. data/vendor/rails/actionview/RUNNING_UJS_TESTS.rdoc +0 -8
  623. data/vendor/rails/actionview/RUNNING_UNIT_TESTS.rdoc +0 -26
  624. data/vendor/rails/actionview/Rakefile +0 -136
  625. data/vendor/rails/actionview/actionview.gemspec +0 -38
  626. data/vendor/rails/actionview/app/assets/javascripts/MIT-LICENSE +0 -20
  627. data/vendor/rails/actionview/app/assets/javascripts/README.md +0 -55
  628. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs.coffee +0 -39
  629. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/BANNER.js +0 -5
  630. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/confirm.coffee +0 -26
  631. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/disable.coffee +0 -82
  632. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/method.coffee +0 -34
  633. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/features/remote.coffee +0 -90
  634. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/start.coffee +0 -71
  635. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee +0 -97
  636. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/csp.coffee +0 -4
  637. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/csrf.coffee +0 -25
  638. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/dom.coffee +0 -35
  639. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/event.coffee +0 -68
  640. data/vendor/rails/actionview/app/assets/javascripts/rails-ujs/utils/form.coffee +0 -36
  641. data/vendor/rails/actionview/bin/test +0 -5
  642. data/vendor/rails/actionview/blade.yml +0 -11
  643. data/vendor/rails/actionview/coffeelint.json +0 -135
  644. data/vendor/rails/actionview/lib/action_view.rb +0 -97
  645. data/vendor/rails/actionview/lib/action_view/base.rb +0 -215
  646. data/vendor/rails/actionview/lib/action_view/buffers.rb +0 -52
  647. data/vendor/rails/actionview/lib/action_view/context.rb +0 -36
  648. data/vendor/rails/actionview/lib/action_view/dependency_tracker.rb +0 -175
  649. data/vendor/rails/actionview/lib/action_view/digestor.rb +0 -136
  650. data/vendor/rails/actionview/lib/action_view/flows.rb +0 -76
  651. data/vendor/rails/actionview/lib/action_view/gem_version.rb +0 -17
  652. data/vendor/rails/actionview/lib/action_view/helpers.rb +0 -68
  653. data/vendor/rails/actionview/lib/action_view/helpers/active_model_helper.rb +0 -55
  654. data/vendor/rails/actionview/lib/action_view/helpers/asset_tag_helper.rb +0 -511
  655. data/vendor/rails/actionview/lib/action_view/helpers/asset_url_helper.rb +0 -469
  656. data/vendor/rails/actionview/lib/action_view/helpers/atom_feed_helper.rb +0 -205
  657. data/vendor/rails/actionview/lib/action_view/helpers/cache_helper.rb +0 -263
  658. data/vendor/rails/actionview/lib/action_view/helpers/capture_helper.rb +0 -212
  659. data/vendor/rails/actionview/lib/action_view/helpers/controller_helper.rb +0 -36
  660. data/vendor/rails/actionview/lib/action_view/helpers/csp_helper.rb +0 -24
  661. data/vendor/rails/actionview/lib/action_view/helpers/csrf_helper.rb +0 -35
  662. data/vendor/rails/actionview/lib/action_view/helpers/date_helper.rb +0 -1156
  663. data/vendor/rails/actionview/lib/action_view/helpers/debug_helper.rb +0 -36
  664. data/vendor/rails/actionview/lib/action_view/helpers/form_helper.rb +0 -2337
  665. data/vendor/rails/actionview/lib/action_view/helpers/form_options_helper.rb +0 -887
  666. data/vendor/rails/actionview/lib/action_view/helpers/form_tag_helper.rb +0 -917
  667. data/vendor/rails/actionview/lib/action_view/helpers/javascript_helper.rb +0 -94
  668. data/vendor/rails/actionview/lib/action_view/helpers/number_helper.rb +0 -451
  669. data/vendor/rails/actionview/lib/action_view/helpers/output_safety_helper.rb +0 -70
  670. data/vendor/rails/actionview/lib/action_view/helpers/record_tag_helper.rb +0 -23
  671. data/vendor/rails/actionview/lib/action_view/helpers/rendering_helper.rb +0 -99
  672. data/vendor/rails/actionview/lib/action_view/helpers/sanitize_helper.rb +0 -177
  673. data/vendor/rails/actionview/lib/action_view/helpers/tag_helper.rb +0 -313
  674. data/vendor/rails/actionview/lib/action_view/helpers/tags.rb +0 -44
  675. data/vendor/rails/actionview/lib/action_view/helpers/tags/base.rb +0 -192
  676. data/vendor/rails/actionview/lib/action_view/helpers/tags/check_box.rb +0 -66
  677. data/vendor/rails/actionview/lib/action_view/helpers/tags/checkable.rb +0 -18
  678. data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_check_boxes.rb +0 -36
  679. data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_helpers.rb +0 -119
  680. data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_radio_buttons.rb +0 -31
  681. data/vendor/rails/actionview/lib/action_view/helpers/tags/collection_select.rb +0 -30
  682. data/vendor/rails/actionview/lib/action_view/helpers/tags/color_field.rb +0 -27
  683. data/vendor/rails/actionview/lib/action_view/helpers/tags/date_field.rb +0 -15
  684. data/vendor/rails/actionview/lib/action_view/helpers/tags/date_select.rb +0 -74
  685. data/vendor/rails/actionview/lib/action_view/helpers/tags/datetime_field.rb +0 -32
  686. data/vendor/rails/actionview/lib/action_view/helpers/tags/datetime_local_field.rb +0 -21
  687. data/vendor/rails/actionview/lib/action_view/helpers/tags/datetime_select.rb +0 -10
  688. data/vendor/rails/actionview/lib/action_view/helpers/tags/email_field.rb +0 -10
  689. data/vendor/rails/actionview/lib/action_view/helpers/tags/file_field.rb +0 -10
  690. data/vendor/rails/actionview/lib/action_view/helpers/tags/grouped_collection_select.rb +0 -31
  691. data/vendor/rails/actionview/lib/action_view/helpers/tags/hidden_field.rb +0 -10
  692. data/vendor/rails/actionview/lib/action_view/helpers/tags/label.rb +0 -81
  693. data/vendor/rails/actionview/lib/action_view/helpers/tags/month_field.rb +0 -15
  694. data/vendor/rails/actionview/lib/action_view/helpers/tags/number_field.rb +0 -20
  695. data/vendor/rails/actionview/lib/action_view/helpers/tags/password_field.rb +0 -14
  696. data/vendor/rails/actionview/lib/action_view/helpers/tags/placeholderable.rb +0 -24
  697. data/vendor/rails/actionview/lib/action_view/helpers/tags/radio_button.rb +0 -33
  698. data/vendor/rails/actionview/lib/action_view/helpers/tags/range_field.rb +0 -10
  699. data/vendor/rails/actionview/lib/action_view/helpers/tags/search_field.rb +0 -27
  700. data/vendor/rails/actionview/lib/action_view/helpers/tags/select.rb +0 -43
  701. data/vendor/rails/actionview/lib/action_view/helpers/tags/tel_field.rb +0 -10
  702. data/vendor/rails/actionview/lib/action_view/helpers/tags/text_area.rb +0 -24
  703. data/vendor/rails/actionview/lib/action_view/helpers/tags/text_field.rb +0 -34
  704. data/vendor/rails/actionview/lib/action_view/helpers/tags/time_field.rb +0 -15
  705. data/vendor/rails/actionview/lib/action_view/helpers/tags/time_select.rb +0 -10
  706. data/vendor/rails/actionview/lib/action_view/helpers/tags/time_zone_select.rb +0 -22
  707. data/vendor/rails/actionview/lib/action_view/helpers/tags/translator.rb +0 -44
  708. data/vendor/rails/actionview/lib/action_view/helpers/tags/url_field.rb +0 -10
  709. data/vendor/rails/actionview/lib/action_view/helpers/tags/week_field.rb +0 -15
  710. data/vendor/rails/actionview/lib/action_view/helpers/text_helper.rb +0 -486
  711. data/vendor/rails/actionview/lib/action_view/helpers/translation_helper.rb +0 -141
  712. data/vendor/rails/actionview/lib/action_view/helpers/url_helper.rb +0 -676
  713. data/vendor/rails/actionview/lib/action_view/layouts.rb +0 -433
  714. data/vendor/rails/actionview/lib/action_view/locale/en.yml +0 -56
  715. data/vendor/rails/actionview/lib/action_view/log_subscriber.rb +0 -96
  716. data/vendor/rails/actionview/lib/action_view/lookup_context.rb +0 -274
  717. data/vendor/rails/actionview/lib/action_view/model_naming.rb +0 -14
  718. data/vendor/rails/actionview/lib/action_view/path_set.rb +0 -100
  719. data/vendor/rails/actionview/lib/action_view/railtie.rb +0 -82
  720. data/vendor/rails/actionview/lib/action_view/record_identifier.rb +0 -112
  721. data/vendor/rails/actionview/lib/action_view/renderer/abstract_renderer.rb +0 -55
  722. data/vendor/rails/actionview/lib/action_view/renderer/partial_renderer.rb +0 -552
  723. data/vendor/rails/actionview/lib/action_view/renderer/partial_renderer/collection_caching.rb +0 -57
  724. data/vendor/rails/actionview/lib/action_view/renderer/renderer.rb +0 -56
  725. data/vendor/rails/actionview/lib/action_view/renderer/streaming_template_renderer.rb +0 -105
  726. data/vendor/rails/actionview/lib/action_view/renderer/template_renderer.rb +0 -102
  727. data/vendor/rails/actionview/lib/action_view/rendering.rb +0 -151
  728. data/vendor/rails/actionview/lib/action_view/routing_url_for.rb +0 -145
  729. data/vendor/rails/actionview/lib/action_view/tasks/cache_digests.rake +0 -25
  730. data/vendor/rails/actionview/lib/action_view/template.rb +0 -361
  731. data/vendor/rails/actionview/lib/action_view/template/error.rb +0 -141
  732. data/vendor/rails/actionview/lib/action_view/template/handlers.rb +0 -66
  733. data/vendor/rails/actionview/lib/action_view/template/handlers/builder.rb +0 -25
  734. data/vendor/rails/actionview/lib/action_view/template/handlers/erb.rb +0 -74
  735. data/vendor/rails/actionview/lib/action_view/template/handlers/erb/erubi.rb +0 -83
  736. data/vendor/rails/actionview/lib/action_view/template/handlers/html.rb +0 -11
  737. data/vendor/rails/actionview/lib/action_view/template/handlers/raw.rb +0 -11
  738. data/vendor/rails/actionview/lib/action_view/template/html.rb +0 -34
  739. data/vendor/rails/actionview/lib/action_view/template/resolver.rb +0 -391
  740. data/vendor/rails/actionview/lib/action_view/template/text.rb +0 -33
  741. data/vendor/rails/actionview/lib/action_view/template/types.rb +0 -57
  742. data/vendor/rails/actionview/lib/action_view/test_case.rb +0 -300
  743. data/vendor/rails/actionview/lib/action_view/testing/resolvers.rb +0 -54
  744. data/vendor/rails/actionview/lib/action_view/version.rb +0 -10
  745. data/vendor/rails/actionview/lib/action_view/view_paths.rb +0 -105
  746. data/vendor/rails/actionview/package.json +0 -36
  747. data/vendor/rails/actionview/test/abstract_unit.rb +0 -236
  748. data/vendor/rails/actionview/test/actionpack/abstract/abstract_controller_test.rb +0 -292
  749. data/vendor/rails/actionview/test/actionpack/abstract/helper_test.rb +0 -128
  750. data/vendor/rails/actionview/test/actionpack/abstract/layouts_test.rb +0 -568
  751. data/vendor/rails/actionview/test/actionpack/abstract/render_test.rb +0 -103
  752. data/vendor/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me3/formatted.html.erb +0 -1
  753. data/vendor/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me3/index.erb +0 -1
  754. data/vendor/rails/actionview/test/actionpack/abstract/views/abstract_controller/testing/me4/index.erb +0 -1
  755. data/vendor/rails/actionview/test/actionpack/abstract/views/action_with_ivars.erb +0 -1
  756. data/vendor/rails/actionview/test/actionpack/abstract/views/helper_test.erb +0 -1
  757. data/vendor/rails/actionview/test/actionpack/abstract/views/index.erb +0 -1
  758. data/vendor/rails/actionview/test/actionpack/abstract/views/layouts/abstract_controller/testing/me4.erb +0 -1
  759. data/vendor/rails/actionview/test/actionpack/abstract/views/layouts/application.erb +0 -1
  760. data/vendor/rails/actionview/test/actionpack/abstract/views/naked_render.erb +0 -1
  761. data/vendor/rails/actionview/test/actionpack/controller/capture_test.rb +0 -83
  762. data/vendor/rails/actionview/test/actionpack/controller/layout_test.rb +0 -270
  763. data/vendor/rails/actionview/test/actionpack/controller/render_test.rb +0 -1294
  764. data/vendor/rails/actionview/test/actionpack/controller/view_paths_test.rb +0 -174
  765. data/vendor/rails/actionview/test/active_record_unit.rb +0 -92
  766. data/vendor/rails/actionview/test/activerecord/controller_runtime_test.rb +0 -95
  767. data/vendor/rails/actionview/test/activerecord/debug_helper_test.rb +0 -19
  768. data/vendor/rails/actionview/test/activerecord/form_helper_activerecord_test.rb +0 -90
  769. data/vendor/rails/actionview/test/activerecord/polymorphic_routes_test.rb +0 -780
  770. data/vendor/rails/actionview/test/activerecord/relation_cache_test.rb +0 -23
  771. data/vendor/rails/actionview/test/activerecord/render_partial_with_record_identification_test.rb +0 -188
  772. data/vendor/rails/actionview/test/fixtures/_top_level_partial.html.erb +0 -1
  773. data/vendor/rails/actionview/test/fixtures/_top_level_partial_only.erb +0 -1
  774. data/vendor/rails/actionview/test/fixtures/actionpack/bad_customers/_bad_customer.html.erb +0 -1
  775. data/vendor/rails/actionview/test/fixtures/actionpack/customers/_customer.html.erb +0 -1
  776. data/vendor/rails/actionview/test/fixtures/actionpack/fun/games/_form.erb +0 -1
  777. data/vendor/rails/actionview/test/fixtures/actionpack/fun/games/hello_world.erb +0 -1
  778. data/vendor/rails/actionview/test/fixtures/actionpack/good_customers/_good_customer.html.erb +0 -1
  779. data/vendor/rails/actionview/test/fixtures/actionpack/hello.html +0 -1
  780. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/alt/layouts/alt.erb +0 -1
  781. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/controller_name_space/nested.erb +0 -1
  782. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/item.erb +0 -1
  783. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/layout_test.erb +0 -1
  784. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/multiple_extensions.html.erb +0 -1
  785. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/symlinked/symlinked_layout.erb +0 -5
  786. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/layouts/third_party_template_library.mab +0 -1
  787. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/views/goodbye.erb +0 -1
  788. data/vendor/rails/actionview/test/fixtures/actionpack/layout_tests/views/hello.erb +0 -1
  789. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_column.html.erb +0 -2
  790. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_customers.erb +0 -1
  791. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_partial_and_yield.erb +0 -2
  792. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_yield_only.erb +0 -1
  793. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/_yield_with_params.erb +0 -1
  794. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/block_with_layout.erb +0 -3
  795. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/builder.builder +0 -3
  796. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/partial_with_layout.erb +0 -3
  797. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/standard.html.erb +0 -1
  798. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/standard.text.erb +0 -1
  799. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/streaming.erb +0 -4
  800. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/talk_from_action.erb +0 -2
  801. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/with_html_partial.html.erb +0 -1
  802. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/xhr.html.erb +0 -2
  803. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/yield.erb +0 -2
  804. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/yield_with_render_inline_inside.erb +0 -2
  805. data/vendor/rails/actionview/test/fixtures/actionpack/layouts/yield_with_render_partial_inside.erb +0 -2
  806. data/vendor/rails/actionview/test/fixtures/actionpack/quiz/questions/_question.html.erb +0 -1
  807. data/vendor/rails/actionview/test/fixtures/actionpack/shared.html.erb +0 -1
  808. data/vendor/rails/actionview/test/fixtures/actionpack/test/_changing_priority.html.erb +0 -1
  809. data/vendor/rails/actionview/test/fixtures/actionpack/test/_changing_priority.json.erb +0 -1
  810. data/vendor/rails/actionview/test/fixtures/actionpack/test/_counter.html.erb +0 -1
  811. data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer.erb +0 -1
  812. data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_counter.erb +0 -1
  813. data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_counter_with_as.erb +0 -1
  814. data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_greeting.erb +0 -1
  815. data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_iteration.erb +0 -1
  816. data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_iteration_with_as.erb +0 -1
  817. data/vendor/rails/actionview/test/fixtures/actionpack/test/_customer_with_var.erb +0 -1
  818. data/vendor/rails/actionview/test/fixtures/actionpack/test/_directory/_partial_with_locales.html.erb +0 -1
  819. data/vendor/rails/actionview/test/fixtures/actionpack/test/_first_json_partial.json.erb +0 -1
  820. data/vendor/rails/actionview/test/fixtures/actionpack/test/_form.erb +0 -1
  821. data/vendor/rails/actionview/test/fixtures/actionpack/test/_hash_greeting.erb +0 -1
  822. data/vendor/rails/actionview/test/fixtures/actionpack/test/_hash_object.erb +0 -2
  823. data/vendor/rails/actionview/test/fixtures/actionpack/test/_hello.builder +0 -1
  824. data/vendor/rails/actionview/test/fixtures/actionpack/test/_json_change_priority.json.erb +0 -0
  825. data/vendor/rails/actionview/test/fixtures/actionpack/test/_labelling_form.erb +0 -1
  826. data/vendor/rails/actionview/test/fixtures/actionpack/test/_layout_for_partial.html.erb +0 -3
  827. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial.erb +0 -1
  828. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial.html.erb +0 -1
  829. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial.js.erb +0 -1
  830. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_for_use_in_layout.html.erb +0 -1
  831. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_html_erb.html.erb +0 -1
  832. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_name_local_variable.erb +0 -1
  833. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_only.erb +0 -1
  834. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_only_html.html +0 -1
  835. data/vendor/rails/actionview/test/fixtures/actionpack/test/_partial_with_partial.erb +0 -2
  836. data/vendor/rails/actionview/test/fixtures/actionpack/test/_person.erb +0 -2
  837. data/vendor/rails/actionview/test/fixtures/actionpack/test/_raise_indentation.html.erb +0 -13
  838. data/vendor/rails/actionview/test/fixtures/actionpack/test/_second_json_partial.json.erb +0 -1
  839. data/vendor/rails/actionview/test/fixtures/actionpack/test/action_talk_to_layout.erb +0 -2
  840. data/vendor/rails/actionview/test/fixtures/actionpack/test/calling_partial_with_layout.html.erb +0 -1
  841. data/vendor/rails/actionview/test/fixtures/actionpack/test/capturing.erb +0 -4
  842. data/vendor/rails/actionview/test/fixtures/actionpack/test/change_priority.html.erb +0 -2
  843. data/vendor/rails/actionview/test/fixtures/actionpack/test/content_for.erb +0 -1
  844. data/vendor/rails/actionview/test/fixtures/actionpack/test/content_for_concatenated.erb +0 -3
  845. data/vendor/rails/actionview/test/fixtures/actionpack/test/content_for_with_parameter.erb +0 -2
  846. data/vendor/rails/actionview/test/fixtures/actionpack/test/dot.directory/render_file_with_ivar.erb +0 -1
  847. data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_html_erb.html.erb +0 -1
  848. data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_xml_erb.builder +0 -1
  849. data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_xml_erb.html.erb +0 -1
  850. data/vendor/rails/actionview/test/fixtures/actionpack/test/formatted_xml_erb.xml.erb +0 -1
  851. data/vendor/rails/actionview/test/fixtures/actionpack/test/greeting.html.erb +0 -1
  852. data/vendor/rails/actionview/test/fixtures/actionpack/test/greeting.xml.erb +0 -1
  853. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello,world.erb +0 -1
  854. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello.builder +0 -4
  855. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello/hello.erb +0 -1
  856. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world.erb +0 -1
  857. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_container.builder +0 -3
  858. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_from_rxml.builder +0 -3
  859. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_with_layout_false.erb +0 -1
  860. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_world_with_partial.html.erb +0 -2
  861. data/vendor/rails/actionview/test/fixtures/actionpack/test/hello_xml_world.builder +0 -11
  862. data/vendor/rails/actionview/test/fixtures/actionpack/test/html_template.html.erb +0 -1
  863. data/vendor/rails/actionview/test/fixtures/actionpack/test/hyphen-ated.erb +0 -1
  864. data/vendor/rails/actionview/test/fixtures/actionpack/test/implicit_content_type.atom.builder +0 -2
  865. data/vendor/rails/actionview/test/fixtures/actionpack/test/list.erb +0 -1
  866. data/vendor/rails/actionview/test/fixtures/actionpack/test/non_erb_block_content_for.builder +0 -4
  867. data/vendor/rails/actionview/test/fixtures/actionpack/test/potential_conflicts.erb +0 -4
  868. data/vendor/rails/actionview/test/fixtures/actionpack/test/proper_block_detection.erb +0 -1
  869. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_from_template.html.erb +0 -1
  870. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_with_ivar.erb +0 -1
  871. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_with_locals.erb +0 -1
  872. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_file_with_locals_and_default.erb +0 -1
  873. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_implicit_html_template_from_xhr_request.da.html.erb +0 -1
  874. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_implicit_html_template_from_xhr_request.html.erb +0 -1
  875. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_implicit_js_template_without_layout.js.erb +0 -1
  876. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_partial_inside_directory.html.erb +0 -1
  877. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_to_string_test.erb +0 -1
  878. data/vendor/rails/actionview/test/fixtures/actionpack/test/render_two_partials.html.erb +0 -2
  879. data/vendor/rails/actionview/test/fixtures/actionpack/test/using_layout_around_block.html.erb +0 -1
  880. data/vendor/rails/actionview/test/fixtures/actionpack/test/with_html_partial.html.erb +0 -1
  881. data/vendor/rails/actionview/test/fixtures/actionpack/test/with_partial.html.erb +0 -1
  882. data/vendor/rails/actionview/test/fixtures/actionpack/test/with_partial.text.erb +0 -1
  883. data/vendor/rails/actionview/test/fixtures/actionpack/test/with_xml_template.html.erb +0 -1
  884. data/vendor/rails/actionview/test/fixtures/comments/empty.de.html.erb +0 -1
  885. data/vendor/rails/actionview/test/fixtures/comments/empty.html+grid.erb +0 -1
  886. data/vendor/rails/actionview/test/fixtures/comments/empty.html.builder +0 -1
  887. data/vendor/rails/actionview/test/fixtures/comments/empty.html.erb +0 -1
  888. data/vendor/rails/actionview/test/fixtures/comments/empty.xml.erb +0 -1
  889. data/vendor/rails/actionview/test/fixtures/companies.yml +0 -24
  890. data/vendor/rails/actionview/test/fixtures/company.rb +0 -11
  891. data/vendor/rails/actionview/test/fixtures/custom_pattern/another.html.erb +0 -1
  892. data/vendor/rails/actionview/test/fixtures/custom_pattern/html/another.erb +0 -1
  893. data/vendor/rails/actionview/test/fixtures/custom_pattern/html/path.erb +0 -1
  894. data/vendor/rails/actionview/test/fixtures/customers/_customer.html.erb +0 -1
  895. data/vendor/rails/actionview/test/fixtures/customers/_customer.xml.erb +0 -1
  896. data/vendor/rails/actionview/test/fixtures/db_definitions/sqlite.sql +0 -49
  897. data/vendor/rails/actionview/test/fixtures/developer.rb +0 -8
  898. data/vendor/rails/actionview/test/fixtures/developers.yml +0 -21
  899. data/vendor/rails/actionview/test/fixtures/developers/_developer.erb +0 -1
  900. data/vendor/rails/actionview/test/fixtures/developers_projects.yml +0 -13
  901. data/vendor/rails/actionview/test/fixtures/digestor/api/comments/_comment.json.erb +0 -1
  902. data/vendor/rails/actionview/test/fixtures/digestor/api/comments/_comments.json.erb +0 -1
  903. data/vendor/rails/actionview/test/fixtures/digestor/comments/_comment.html.erb +0 -1
  904. data/vendor/rails/actionview/test/fixtures/digestor/comments/_comments.html.erb +0 -1
  905. data/vendor/rails/actionview/test/fixtures/digestor/comments/show.js.erb +0 -1
  906. data/vendor/rails/actionview/test/fixtures/digestor/events/_completed.html.erb +0 -0
  907. data/vendor/rails/actionview/test/fixtures/digestor/events/_event.html.erb +0 -0
  908. data/vendor/rails/actionview/test/fixtures/digestor/events/index.html.erb +0 -1
  909. data/vendor/rails/actionview/test/fixtures/digestor/level/_recursion.html.erb +0 -1
  910. data/vendor/rails/actionview/test/fixtures/digestor/level/below/_header.html.erb +0 -0
  911. data/vendor/rails/actionview/test/fixtures/digestor/level/below/index.html.erb +0 -1
  912. data/vendor/rails/actionview/test/fixtures/digestor/level/recursion.html.erb +0 -1
  913. data/vendor/rails/actionview/test/fixtures/digestor/messages/_form.html.erb +0 -0
  914. data/vendor/rails/actionview/test/fixtures/digestor/messages/_header.html.erb +0 -0
  915. data/vendor/rails/actionview/test/fixtures/digestor/messages/_message.html.erb +0 -1
  916. data/vendor/rails/actionview/test/fixtures/digestor/messages/actions/_move.html.erb +0 -0
  917. data/vendor/rails/actionview/test/fixtures/digestor/messages/edit.html.erb +0 -5
  918. data/vendor/rails/actionview/test/fixtures/digestor/messages/index.html.erb +0 -2
  919. data/vendor/rails/actionview/test/fixtures/digestor/messages/new.html+iphone.erb +0 -15
  920. data/vendor/rails/actionview/test/fixtures/digestor/messages/peek.html.erb +0 -2
  921. data/vendor/rails/actionview/test/fixtures/digestor/messages/show.html.erb +0 -14
  922. data/vendor/rails/actionview/test/fixtures/digestor/messages/thread.json.erb +0 -1
  923. data/vendor/rails/actionview/test/fixtures/fun/games/_game.erb +0 -1
  924. data/vendor/rails/actionview/test/fixtures/fun/games/hello_world.erb +0 -1
  925. data/vendor/rails/actionview/test/fixtures/fun/serious/games/_game.erb +0 -1
  926. data/vendor/rails/actionview/test/fixtures/games/_game.erb +0 -1
  927. data/vendor/rails/actionview/test/fixtures/good_customers/_good_customer.html.erb +0 -1
  928. data/vendor/rails/actionview/test/fixtures/helpers/abc_helper.rb +0 -5
  929. data/vendor/rails/actionview/test/fixtures/helpers/helpery_test_helper.rb +0 -7
  930. data/vendor/rails/actionview/test/fixtures/helpers_missing/invalid_require_helper.rb +0 -6
  931. data/vendor/rails/actionview/test/fixtures/layout_tests/alt/hello.erb +0 -1
  932. data/vendor/rails/actionview/test/fixtures/layouts/_column.html.erb +0 -2
  933. data/vendor/rails/actionview/test/fixtures/layouts/_customers.erb +0 -1
  934. data/vendor/rails/actionview/test/fixtures/layouts/_partial_and_yield.erb +0 -2
  935. data/vendor/rails/actionview/test/fixtures/layouts/_yield_only.erb +0 -1
  936. data/vendor/rails/actionview/test/fixtures/layouts/_yield_with_params.erb +0 -1
  937. data/vendor/rails/actionview/test/fixtures/layouts/render_partial_html.erb +0 -2
  938. data/vendor/rails/actionview/test/fixtures/layouts/streaming.erb +0 -4
  939. data/vendor/rails/actionview/test/fixtures/layouts/streaming_with_capture.erb +0 -6
  940. data/vendor/rails/actionview/test/fixtures/layouts/streaming_with_locale.erb +0 -2
  941. data/vendor/rails/actionview/test/fixtures/layouts/yield.erb +0 -2
  942. data/vendor/rails/actionview/test/fixtures/layouts/yield_with_render_inline_inside.erb +0 -2
  943. data/vendor/rails/actionview/test/fixtures/layouts/yield_with_render_partial_inside.erb +0 -2
  944. data/vendor/rails/actionview/test/fixtures/mascot.rb +0 -5
  945. data/vendor/rails/actionview/test/fixtures/mascots.yml +0 -4
  946. data/vendor/rails/actionview/test/fixtures/mascots/_mascot.html.erb +0 -1
  947. data/vendor/rails/actionview/test/fixtures/override/test/hello_world.erb +0 -1
  948. data/vendor/rails/actionview/test/fixtures/override2/layouts/test/sub.erb +0 -1
  949. data/vendor/rails/actionview/test/fixtures/plain_text.raw +0 -1
  950. data/vendor/rails/actionview/test/fixtures/plain_text_with_characters.raw +0 -1
  951. data/vendor/rails/actionview/test/fixtures/project.rb +0 -9
  952. data/vendor/rails/actionview/test/fixtures/projects.yml +0 -7
  953. data/vendor/rails/actionview/test/fixtures/projects/_project.erb +0 -1
  954. data/vendor/rails/actionview/test/fixtures/public/elsewhere/cools.js +0 -1
  955. data/vendor/rails/actionview/test/fixtures/public/elsewhere/file.css +0 -1
  956. data/vendor/rails/actionview/test/fixtures/public/foo/baz.css +0 -3
  957. data/vendor/rails/actionview/test/fixtures/public/javascripts/application.js +0 -1
  958. data/vendor/rails/actionview/test/fixtures/public/javascripts/bank.js +0 -1
  959. data/vendor/rails/actionview/test/fixtures/public/javascripts/common.javascript +0 -1
  960. data/vendor/rails/actionview/test/fixtures/public/javascripts/controls.js +0 -1
  961. data/vendor/rails/actionview/test/fixtures/public/javascripts/dragdrop.js +0 -1
  962. data/vendor/rails/actionview/test/fixtures/public/javascripts/effects.js +0 -1
  963. data/vendor/rails/actionview/test/fixtures/public/javascripts/prototype.js +0 -1
  964. data/vendor/rails/actionview/test/fixtures/public/javascripts/robber.js +0 -1
  965. data/vendor/rails/actionview/test/fixtures/public/javascripts/subdir/subdir.js +0 -1
  966. data/vendor/rails/actionview/test/fixtures/public/javascripts/version.1.0.js +0 -1
  967. data/vendor/rails/actionview/test/fixtures/public/stylesheets/bank.css +0 -1
  968. data/vendor/rails/actionview/test/fixtures/public/stylesheets/random.styles +0 -1
  969. data/vendor/rails/actionview/test/fixtures/public/stylesheets/robber.css +0 -1
  970. data/vendor/rails/actionview/test/fixtures/public/stylesheets/subdir/subdir.css +0 -1
  971. data/vendor/rails/actionview/test/fixtures/public/stylesheets/version.1.0.css +0 -1
  972. data/vendor/rails/actionview/test/fixtures/replies.yml +0 -15
  973. data/vendor/rails/actionview/test/fixtures/replies/_reply.erb +0 -1
  974. data/vendor/rails/actionview/test/fixtures/reply.rb +0 -9
  975. data/vendor/rails/actionview/test/fixtures/respond_to/using_defaults_with_all.html.erb +0 -1
  976. data/vendor/rails/actionview/test/fixtures/ruby_template.ruby +0 -2
  977. data/vendor/rails/actionview/test/fixtures/shared.html.erb +0 -1
  978. data/vendor/rails/actionview/test/fixtures/test/_200.html.erb +0 -1
  979. data/vendor/rails/actionview/test/fixtures/test/_FooBar.html.erb +0 -1
  980. data/vendor/rails/actionview/test/fixtures/test/_a-in.html.erb +0 -0
  981. data/vendor/rails/actionview/test/fixtures/test/_b_layout_for_partial.html.erb +0 -1
  982. data/vendor/rails/actionview/test/fixtures/test/_b_layout_for_partial_with_object.html.erb +0 -1
  983. data/vendor/rails/actionview/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb +0 -1
  984. data/vendor/rails/actionview/test/fixtures/test/_builder_tag_nested_in_content_tag.erb +0 -3
  985. data/vendor/rails/actionview/test/fixtures/test/_cached_customer.erb +0 -3
  986. data/vendor/rails/actionview/test/fixtures/test/_cached_customer_as.erb +0 -3
  987. data/vendor/rails/actionview/test/fixtures/test/_cached_nested_cached_customer.erb +0 -3
  988. data/vendor/rails/actionview/test/fixtures/test/_changing_priority.html.erb +0 -1
  989. data/vendor/rails/actionview/test/fixtures/test/_changing_priority.json.erb +0 -1
  990. data/vendor/rails/actionview/test/fixtures/test/_content_tag_nested_in_content_tag.erb +0 -3
  991. data/vendor/rails/actionview/test/fixtures/test/_counter.html.erb +0 -1
  992. data/vendor/rails/actionview/test/fixtures/test/_customer.erb +0 -1
  993. data/vendor/rails/actionview/test/fixtures/test/_customer.mobile.erb +0 -1
  994. data/vendor/rails/actionview/test/fixtures/test/_customer_greeting.erb +0 -1
  995. data/vendor/rails/actionview/test/fixtures/test/_customer_with_var.erb +0 -1
  996. data/vendor/rails/actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb +0 -1
  997. data/vendor/rails/actionview/test/fixtures/test/_first_json_partial.json.erb +0 -1
  998. data/vendor/rails/actionview/test/fixtures/test/_from_helper.erb +0 -1
  999. data/vendor/rails/actionview/test/fixtures/test/_json_change_priority.json.erb +0 -0
  1000. data/vendor/rails/actionview/test/fixtures/test/_klass.erb +0 -1
  1001. data/vendor/rails/actionview/test/fixtures/test/_label_with_block.erb +0 -4
  1002. data/vendor/rails/actionview/test/fixtures/test/_layout_for_block_with_args.html.erb +0 -3
  1003. data/vendor/rails/actionview/test/fixtures/test/_layout_for_partial.html.erb +0 -3
  1004. data/vendor/rails/actionview/test/fixtures/test/_layout_with_partial_and_yield.html.erb +0 -4
  1005. data/vendor/rails/actionview/test/fixtures/test/_local_inspector.html.erb +0 -1
  1006. data/vendor/rails/actionview/test/fixtures/test/_nested_cached_customer.erb +0 -1
  1007. data/vendor/rails/actionview/test/fixtures/test/_object_inspector.erb +0 -1
  1008. data/vendor/rails/actionview/test/fixtures/test/_one.html.erb +0 -1
  1009. data/vendor/rails/actionview/test/fixtures/test/_partial.erb +0 -1
  1010. data/vendor/rails/actionview/test/fixtures/test/_partial.html.erb +0 -1
  1011. data/vendor/rails/actionview/test/fixtures/test/_partial.js.erb +0 -1
  1012. data/vendor/rails/actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb +0 -1
  1013. data/vendor/rails/actionview/test/fixtures/test/_partial_iteration_1.erb +0 -1
  1014. data/vendor/rails/actionview/test/fixtures/test/_partial_iteration_2.erb +0 -1
  1015. data/vendor/rails/actionview/test/fixtures/test/_partial_name_in_local_assigns.erb +0 -1
  1016. data/vendor/rails/actionview/test/fixtures/test/_partial_name_local_variable.erb +0 -1
  1017. data/vendor/rails/actionview/test/fixtures/test/_partial_only.erb +0 -1
  1018. data/vendor/rails/actionview/test/fixtures/test/_partial_shortcut_with_block_content.html.erb +0 -3
  1019. data/vendor/rails/actionview/test/fixtures/test/_partial_with_layout.erb +0 -2
  1020. data/vendor/rails/actionview/test/fixtures/test/_partial_with_layout_block_content.erb +0 -4
  1021. data/vendor/rails/actionview/test/fixtures/test/_partial_with_layout_block_partial.erb +0 -4
  1022. data/vendor/rails/actionview/test/fixtures/test/_partial_with_only_html_version.html.erb +0 -1
  1023. data/vendor/rails/actionview/test/fixtures/test/_partial_with_partial.erb +0 -2
  1024. data/vendor/rails/actionview/test/fixtures/test/_partial_with_variants.html+grid.erb +0 -1
  1025. data/vendor/rails/actionview/test/fixtures/test/_partialhtml.html +0 -1
  1026. data/vendor/rails/actionview/test/fixtures/test/_raise.html.erb +0 -1
  1027. data/vendor/rails/actionview/test/fixtures/test/_raise_indentation.html.erb +0 -13
  1028. data/vendor/rails/actionview/test/fixtures/test/_second_json_partial.json.erb +0 -1
  1029. data/vendor/rails/actionview/test/fixtures/test/_two.html.erb +0 -1
  1030. data/vendor/rails/actionview/test/fixtures/test/_utf8_partial.html.erb +0 -1
  1031. data/vendor/rails/actionview/test/fixtures/test/_utf8_partial_magic.html.erb +0 -2
  1032. data/vendor/rails/actionview/test/fixtures/test/_/360/237/215/243.erb +0 -1
  1033. data/vendor/rails/actionview/test/fixtures/test/basic.html.erb +0 -1
  1034. data/vendor/rails/actionview/test/fixtures/test/calling_partial_with_layout.html.erb +0 -1
  1035. data/vendor/rails/actionview/test/fixtures/test/change_priority.html.erb +0 -2
  1036. data/vendor/rails/actionview/test/fixtures/test/dont_pick_me +0 -1
  1037. data/vendor/rails/actionview/test/fixtures/test/dot.directory/render_file_with_ivar.erb +0 -1
  1038. data/vendor/rails/actionview/test/fixtures/test/greeting.xml.erb +0 -1
  1039. data/vendor/rails/actionview/test/fixtures/test/hello.builder +0 -4
  1040. data/vendor/rails/actionview/test/fixtures/test/hello/hello.erb +0 -1
  1041. data/vendor/rails/actionview/test/fixtures/test/hello_world.da.html.erb +0 -1
  1042. data/vendor/rails/actionview/test/fixtures/test/hello_world.erb +0 -1
  1043. data/vendor/rails/actionview/test/fixtures/test/hello_world.erb~ +0 -1
  1044. data/vendor/rails/actionview/test/fixtures/test/hello_world.html+phone.erb +0 -1
  1045. data/vendor/rails/actionview/test/fixtures/test/hello_world.pt-BR.html.erb +0 -1
  1046. data/vendor/rails/actionview/test/fixtures/test/hello_world.text+phone.erb +0 -1
  1047. data/vendor/rails/actionview/test/fixtures/test/hello_world_with_partial.html.erb +0 -2
  1048. data/vendor/rails/actionview/test/fixtures/test/html_template.html.erb +0 -1
  1049. data/vendor/rails/actionview/test/fixtures/test/layout_render_file.erb +0 -2
  1050. data/vendor/rails/actionview/test/fixtures/test/layout_render_object.erb +0 -1
  1051. data/vendor/rails/actionview/test/fixtures/test/list.erb +0 -1
  1052. data/vendor/rails/actionview/test/fixtures/test/malformed/malformed.en.html.erb~ +0 -1
  1053. data/vendor/rails/actionview/test/fixtures/test/malformed/malformed.erb~ +0 -1
  1054. data/vendor/rails/actionview/test/fixtures/test/malformed/malformed.html.erb~ +0 -1
  1055. data/vendor/rails/actionview/test/fixtures/test/malformed/malformed~ +0 -1
  1056. data/vendor/rails/actionview/test/fixtures/test/nested_layout.erb +0 -3
  1057. data/vendor/rails/actionview/test/fixtures/test/nested_streaming.erb +0 -3
  1058. data/vendor/rails/actionview/test/fixtures/test/nil_return.erb +0 -1
  1059. data/vendor/rails/actionview/test/fixtures/test/one.html.erb +0 -1
  1060. data/vendor/rails/actionview/test/fixtures/test/render_file_inspect_local_assigns.erb +0 -1
  1061. data/vendor/rails/actionview/test/fixtures/test/render_file_instance_variable.erb +0 -1
  1062. data/vendor/rails/actionview/test/fixtures/test/render_file_unicode_local.erb +0 -1
  1063. data/vendor/rails/actionview/test/fixtures/test/render_file_with_ivar.erb +0 -1
  1064. data/vendor/rails/actionview/test/fixtures/test/render_file_with_locals.erb +0 -1
  1065. data/vendor/rails/actionview/test/fixtures/test/render_file_with_locals_and_default.erb +0 -1
  1066. data/vendor/rails/actionview/test/fixtures/test/render_file_with_ruby_keyword_locals.erb +0 -1
  1067. data/vendor/rails/actionview/test/fixtures/test/render_partial_inside_directory.html.erb +0 -1
  1068. data/vendor/rails/actionview/test/fixtures/test/render_two_partials.html.erb +0 -2
  1069. data/vendor/rails/actionview/test/fixtures/test/streaming.erb +0 -3
  1070. data/vendor/rails/actionview/test/fixtures/test/streaming_buster.erb +0 -3
  1071. data/vendor/rails/actionview/test/fixtures/test/streaming_with_locale.erb +0 -1
  1072. data/vendor/rails/actionview/test/fixtures/test/sub_template_raise.html.erb +0 -1
  1073. data/vendor/rails/actionview/test/fixtures/test/template.erb +0 -1
  1074. data/vendor/rails/actionview/test/fixtures/test/test_template_with_delegation_reserved_keywords.erb +0 -1
  1075. data/vendor/rails/actionview/test/fixtures/test/update_element_with_capture.erb +0 -9
  1076. data/vendor/rails/actionview/test/fixtures/test/utf8.html.erb +0 -4
  1077. data/vendor/rails/actionview/test/fixtures/test/utf8_magic.html.erb +0 -5
  1078. data/vendor/rails/actionview/test/fixtures/test/utf8_magic_with_bare_partial.html.erb +0 -5
  1079. data/vendor/rails/actionview/test/fixtures/topic.rb +0 -5
  1080. data/vendor/rails/actionview/test/fixtures/topics.yml +0 -22
  1081. data/vendor/rails/actionview/test/fixtures/topics/_topic.html.erb +0 -1
  1082. data/vendor/rails/actionview/test/fixtures/translations/templates/array.erb +0 -1
  1083. data/vendor/rails/actionview/test/fixtures/translations/templates/default.erb +0 -1
  1084. data/vendor/rails/actionview/test/fixtures/translations/templates/found.erb +0 -1
  1085. data/vendor/rails/actionview/test/fixtures/translations/templates/missing.erb +0 -1
  1086. data/vendor/rails/actionview/test/fixtures/with_format.json.erb +0 -1
  1087. data/vendor/rails/actionview/test/lib/controller/fake_models.rb +0 -204
  1088. data/vendor/rails/actionview/test/template/active_model_helper_test.rb +0 -172
  1089. data/vendor/rails/actionview/test/template/asset_tag_helper_test.rb +0 -913
  1090. data/vendor/rails/actionview/test/template/atom_feed_helper_test.rb +0 -375
  1091. data/vendor/rails/actionview/test/template/capture_helper_test.rb +0 -228
  1092. data/vendor/rails/actionview/test/template/compiled_templates_test.rb +0 -94
  1093. data/vendor/rails/actionview/test/template/controller_helper_test.rb +0 -34
  1094. data/vendor/rails/actionview/test/template/date_helper_i18n_test.rb +0 -166
  1095. data/vendor/rails/actionview/test/template/date_helper_test.rb +0 -3642
  1096. data/vendor/rails/actionview/test/template/dependency_tracker_test.rb +0 -195
  1097. data/vendor/rails/actionview/test/template/digestor_test.rb +0 -389
  1098. data/vendor/rails/actionview/test/template/erb/form_for_test.rb +0 -13
  1099. data/vendor/rails/actionview/test/template/erb/helper.rb +0 -26
  1100. data/vendor/rails/actionview/test/template/erb/tag_helper_test.rb +0 -32
  1101. data/vendor/rails/actionview/test/template/erb_util_test.rb +0 -114
  1102. data/vendor/rails/actionview/test/template/form_collections_helper_test.rb +0 -527
  1103. data/vendor/rails/actionview/test/template/form_helper/form_with_test.rb +0 -2293
  1104. data/vendor/rails/actionview/test/template/form_helper_test.rb +0 -3554
  1105. data/vendor/rails/actionview/test/template/form_options_helper_i18n_test.rb +0 -30
  1106. data/vendor/rails/actionview/test/template/form_options_helper_test.rb +0 -1452
  1107. data/vendor/rails/actionview/test/template/form_tag_helper_test.rb +0 -785
  1108. data/vendor/rails/actionview/test/template/html_test.rb +0 -19
  1109. data/vendor/rails/actionview/test/template/javascript_helper_test.rb +0 -68
  1110. data/vendor/rails/actionview/test/template/log_subscriber_test.rb +0 -224
  1111. data/vendor/rails/actionview/test/template/lookup_context_test.rb +0 -289
  1112. data/vendor/rails/actionview/test/template/number_helper_test.rb +0 -204
  1113. data/vendor/rails/actionview/test/template/output_safety_helper_test.rb +0 -119
  1114. data/vendor/rails/actionview/test/template/partial_iteration_test.rb +0 -35
  1115. data/vendor/rails/actionview/test/template/record_identifier_test.rb +0 -93
  1116. data/vendor/rails/actionview/test/template/record_tag_helper_test.rb +0 -33
  1117. data/vendor/rails/actionview/test/template/render_test.rb +0 -725
  1118. data/vendor/rails/actionview/test/template/resolver_cache_test.rb +0 -9
  1119. data/vendor/rails/actionview/test/template/resolver_patterns_test.rb +0 -44
  1120. data/vendor/rails/actionview/test/template/sanitize_helper_test.rb +0 -43
  1121. data/vendor/rails/actionview/test/template/streaming_render_test.rb +0 -132
  1122. data/vendor/rails/actionview/test/template/tag_helper_test.rb +0 -357
  1123. data/vendor/rails/actionview/test/template/template_error_test.rb +0 -37
  1124. data/vendor/rails/actionview/test/template/template_test.rb +0 -207
  1125. data/vendor/rails/actionview/test/template/test_case_test.rb +0 -335
  1126. data/vendor/rails/actionview/test/template/test_test.rb +0 -94
  1127. data/vendor/rails/actionview/test/template/testing/fixture_resolver_test.rb +0 -20
  1128. data/vendor/rails/actionview/test/template/testing/null_resolver_test.rb +0 -14
  1129. data/vendor/rails/actionview/test/template/text_helper_test.rb +0 -535
  1130. data/vendor/rails/actionview/test/template/text_test.rb +0 -25
  1131. data/vendor/rails/actionview/test/template/translation_helper_test.rb +0 -238
  1132. data/vendor/rails/actionview/test/template/url_helper_test.rb +0 -976
  1133. data/vendor/rails/actionview/test/ujs/config.ru +0 -6
  1134. data/vendor/rails/actionview/test/ujs/public/test/call-ajax.js +0 -26
  1135. data/vendor/rails/actionview/test/ujs/public/test/call-remote-callbacks.js +0 -239
  1136. data/vendor/rails/actionview/test/ujs/public/test/call-remote.js +0 -275
  1137. data/vendor/rails/actionview/test/ujs/public/test/csrf-refresh.js +0 -24
  1138. data/vendor/rails/actionview/test/ujs/public/test/csrf-token.js +0 -27
  1139. data/vendor/rails/actionview/test/ujs/public/test/data-confirm.js +0 -316
  1140. data/vendor/rails/actionview/test/ujs/public/test/data-disable-with.js +0 -394
  1141. data/vendor/rails/actionview/test/ujs/public/test/data-disable.js +0 -322
  1142. data/vendor/rails/actionview/test/ujs/public/test/data-method.js +0 -85
  1143. data/vendor/rails/actionview/test/ujs/public/test/data-remote.js +0 -441
  1144. data/vendor/rails/actionview/test/ujs/public/test/override.js +0 -56
  1145. data/vendor/rails/actionview/test/ujs/public/test/settings.js +0 -118
  1146. data/vendor/rails/actionview/test/ujs/public/vendor/jquery-2.2.0.js +0 -9831
  1147. data/vendor/rails/actionview/test/ujs/public/vendor/jquery.metadata.js +0 -122
  1148. data/vendor/rails/actionview/test/ujs/public/vendor/qunit.css +0 -237
  1149. data/vendor/rails/actionview/test/ujs/public/vendor/qunit.js +0 -2288
  1150. data/vendor/rails/actionview/test/ujs/server.rb +0 -86
  1151. data/vendor/rails/actionview/test/ujs/views/layouts/application.html.erb +0 -26
  1152. data/vendor/rails/actionview/test/ujs/views/tests/index.html.erb +0 -11
  1153. data/vendor/rails/ci/qunit-selenium-runner.rb +0 -16
  1154. data/vendor/rails/ci/travis.rb +0 -187
  1155. data/vendor/rails/rails.gemspec +0 -36
  1156. data/vendor/rails/version.rb +0 -17
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module ActionView
4
- # = Action View Debug Helper
5
- #
6
- # Provides a set of methods for making it easier to debug Rails objects.
7
- module Helpers #:nodoc:
8
- module DebugHelper
9
- include TagHelper
10
-
11
- # Returns a YAML representation of +object+ wrapped with <pre> and </pre>.
12
- # If the object cannot be converted to YAML using +to_yaml+, +inspect+ will be called instead.
13
- # Useful for inspecting an object at the time of rendering.
14
- #
15
- # @user = User.new({ username: 'testing', password: 'xyz', age: 42})
16
- # debug(@user)
17
- # # =>
18
- # <pre class='debug_dump'>--- !ruby/object:User
19
- # attributes:
20
- # updated_at:
21
- # username: testing
22
- # age: 42
23
- # password: xyz
24
- # created_at:
25
- # </pre>
26
- def debug(object)
27
- Marshal.dump(object)
28
- object = ERB::Util.html_escape(object.to_yaml)
29
- content_tag(:pre, object, class: "debug_dump")
30
- rescue # errors from Marshal or YAML
31
- # Object couldn't be dumped, perhaps because of singleton methods -- this is the fallback
32
- content_tag(:code, object.inspect, class: "debug_dump")
33
- end
34
- end
35
- end
36
- end
@@ -1,2337 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "cgi"
4
- require "action_view/helpers/date_helper"
5
- require "action_view/helpers/tag_helper"
6
- require "action_view/helpers/form_tag_helper"
7
- require "action_view/helpers/active_model_helper"
8
- require "action_view/model_naming"
9
- require "action_view/record_identifier"
10
- require "active_support/core_ext/module/attribute_accessors"
11
- require "active_support/core_ext/hash/slice"
12
- require "active_support/core_ext/string/output_safety"
13
- require "active_support/core_ext/string/inflections"
14
-
15
- module ActionView
16
- # = Action View Form Helpers
17
- module Helpers #:nodoc:
18
- # Form helpers are designed to make working with resources much easier
19
- # compared to using vanilla HTML.
20
- #
21
- # Typically, a form designed to create or update a resource reflects the
22
- # identity of the resource in several ways: (i) the URL that the form is
23
- # sent to (the form element's +action+ attribute) should result in a request
24
- # being routed to the appropriate controller action (with the appropriate <tt>:id</tt>
25
- # parameter in the case of an existing resource), (ii) input fields should
26
- # be named in such a way that in the controller their values appear in the
27
- # appropriate places within the +params+ hash, and (iii) for an existing record,
28
- # when the form is initially displayed, input fields corresponding to attributes
29
- # of the resource should show the current values of those attributes.
30
- #
31
- # In Rails, this is usually achieved by creating the form using +form_for+ and
32
- # a number of related helper methods. +form_for+ generates an appropriate <tt>form</tt>
33
- # tag and yields a form builder object that knows the model the form is about.
34
- # Input fields are created by calling methods defined on the form builder, which
35
- # means they are able to generate the appropriate names and default values
36
- # corresponding to the model attributes, as well as convenient IDs, etc.
37
- # Conventions in the generated field names allow controllers to receive form data
38
- # nicely structured in +params+ with no effort on your side.
39
- #
40
- # For example, to create a new person you typically set up a new instance of
41
- # +Person+ in the <tt>PeopleController#new</tt> action, <tt>@person</tt>, and
42
- # in the view template pass that object to +form_for+:
43
- #
44
- # <%= form_for @person do |f| %>
45
- # <%= f.label :first_name %>:
46
- # <%= f.text_field :first_name %><br />
47
- #
48
- # <%= f.label :last_name %>:
49
- # <%= f.text_field :last_name %><br />
50
- #
51
- # <%= f.submit %>
52
- # <% end %>
53
- #
54
- # The HTML generated for this would be (modulus formatting):
55
- #
56
- # <form action="/people" class="new_person" id="new_person" method="post">
57
- # <input name="authenticity_token" type="hidden" value="NrOp5bsjoLRuK8IW5+dQEYjKGUJDe7TQoZVvq95Wteg=" />
58
- # <label for="person_first_name">First name</label>:
59
- # <input id="person_first_name" name="person[first_name]" type="text" /><br />
60
- #
61
- # <label for="person_last_name">Last name</label>:
62
- # <input id="person_last_name" name="person[last_name]" type="text" /><br />
63
- #
64
- # <input name="commit" type="submit" value="Create Person" />
65
- # </form>
66
- #
67
- # As you see, the HTML reflects knowledge about the resource in several spots,
68
- # like the path the form should be submitted to, or the names of the input fields.
69
- #
70
- # In particular, thanks to the conventions followed in the generated field names, the
71
- # controller gets a nested hash <tt>params[:person]</tt> with the person attributes
72
- # set in the form. That hash is ready to be passed to <tt>Person.new</tt>:
73
- #
74
- # @person = Person.new(params[:person])
75
- # if @person.save
76
- # # success
77
- # else
78
- # # error handling
79
- # end
80
- #
81
- # Interestingly, the exact same view code in the previous example can be used to edit
82
- # a person. If <tt>@person</tt> is an existing record with name "John Smith" and ID 256,
83
- # the code above as is would yield instead:
84
- #
85
- # <form action="/people/256" class="edit_person" id="edit_person_256" method="post">
86
- # <input name="_method" type="hidden" value="patch" />
87
- # <input name="authenticity_token" type="hidden" value="NrOp5bsjoLRuK8IW5+dQEYjKGUJDe7TQoZVvq95Wteg=" />
88
- # <label for="person_first_name">First name</label>:
89
- # <input id="person_first_name" name="person[first_name]" type="text" value="John" /><br />
90
- #
91
- # <label for="person_last_name">Last name</label>:
92
- # <input id="person_last_name" name="person[last_name]" type="text" value="Smith" /><br />
93
- #
94
- # <input name="commit" type="submit" value="Update Person" />
95
- # </form>
96
- #
97
- # Note that the endpoint, default values, and submit button label are tailored for <tt>@person</tt>.
98
- # That works that way because the involved helpers know whether the resource is a new record or not,
99
- # and generate HTML accordingly.
100
- #
101
- # The controller would receive the form data again in <tt>params[:person]</tt>, ready to be
102
- # passed to <tt>Person#update</tt>:
103
- #
104
- # if @person.update(params[:person])
105
- # # success
106
- # else
107
- # # error handling
108
- # end
109
- #
110
- # That's how you typically work with resources.
111
- module FormHelper
112
- extend ActiveSupport::Concern
113
-
114
- include FormTagHelper
115
- include UrlHelper
116
- include ModelNaming
117
- include RecordIdentifier
118
-
119
- attr_internal :default_form_builder
120
-
121
- # Creates a form that allows the user to create or update the attributes
122
- # of a specific model object.
123
- #
124
- # The method can be used in several slightly different ways, depending on
125
- # how much you wish to rely on Rails to infer automatically from the model
126
- # how the form should be constructed. For a generic model object, a form
127
- # can be created by passing +form_for+ a string or symbol representing
128
- # the object we are concerned with:
129
- #
130
- # <%= form_for :person do |f| %>
131
- # First name: <%= f.text_field :first_name %><br />
132
- # Last name : <%= f.text_field :last_name %><br />
133
- # Biography : <%= f.text_area :biography %><br />
134
- # Admin? : <%= f.check_box :admin %><br />
135
- # <%= f.submit %>
136
- # <% end %>
137
- #
138
- # The variable +f+ yielded to the block is a FormBuilder object that
139
- # incorporates the knowledge about the model object represented by
140
- # <tt>:person</tt> passed to +form_for+. Methods defined on the FormBuilder
141
- # are used to generate fields bound to this model. Thus, for example,
142
- #
143
- # <%= f.text_field :first_name %>
144
- #
145
- # will get expanded to
146
- #
147
- # <%= text_field :person, :first_name %>
148
- #
149
- # which results in an HTML <tt><input></tt> tag whose +name+ attribute is
150
- # <tt>person[first_name]</tt>. This means that when the form is submitted,
151
- # the value entered by the user will be available in the controller as
152
- # <tt>params[:person][:first_name]</tt>.
153
- #
154
- # For fields generated in this way using the FormBuilder,
155
- # if <tt>:person</tt> also happens to be the name of an instance variable
156
- # <tt>@person</tt>, the default value of the field shown when the form is
157
- # initially displayed (e.g. in the situation where you are editing an
158
- # existing record) will be the value of the corresponding attribute of
159
- # <tt>@person</tt>.
160
- #
161
- # The rightmost argument to +form_for+ is an
162
- # optional hash of options -
163
- #
164
- # * <tt>:url</tt> - The URL the form is to be submitted to. This may be
165
- # represented in the same way as values passed to +url_for+ or +link_to+.
166
- # So for example you may use a named route directly. When the model is
167
- # represented by a string or symbol, as in the example above, if the
168
- # <tt>:url</tt> option is not specified, by default the form will be
169
- # sent back to the current URL (We will describe below an alternative
170
- # resource-oriented usage of +form_for+ in which the URL does not need
171
- # to be specified explicitly).
172
- # * <tt>:namespace</tt> - A namespace for your form to ensure uniqueness of
173
- # id attributes on form elements. The namespace attribute will be prefixed
174
- # with underscore on the generated HTML id.
175
- # * <tt>:method</tt> - The method to use when submitting the form, usually
176
- # either "get" or "post". If "patch", "put", "delete", or another verb
177
- # is used, a hidden input with name <tt>_method</tt> is added to
178
- # simulate the verb over post.
179
- # * <tt>:authenticity_token</tt> - Authenticity token to use in the form.
180
- # Use only if you need to pass custom authenticity token string, or to
181
- # not add authenticity_token field at all (by passing <tt>false</tt>).
182
- # Remote forms may omit the embedded authenticity token by setting
183
- # <tt>config.action_view.embed_authenticity_token_in_remote_forms = false</tt>.
184
- # This is helpful when you're fragment-caching the form. Remote forms
185
- # get the authenticity token from the <tt>meta</tt> tag, so embedding is
186
- # unnecessary unless you support browsers without JavaScript.
187
- # * <tt>:remote</tt> - If set to true, will allow the Unobtrusive
188
- # JavaScript drivers to control the submit behavior. By default this
189
- # behavior is an ajax submit.
190
- # * <tt>:enforce_utf8</tt> - If set to false, a hidden input with name
191
- # utf8 is not output.
192
- # * <tt>:html</tt> - Optional HTML attributes for the form tag.
193
- #
194
- # Also note that +form_for+ doesn't create an exclusive scope. It's still
195
- # possible to use both the stand-alone FormHelper methods and methods
196
- # from FormTagHelper. For example:
197
- #
198
- # <%= form_for :person do |f| %>
199
- # First name: <%= f.text_field :first_name %>
200
- # Last name : <%= f.text_field :last_name %>
201
- # Biography : <%= text_area :person, :biography %>
202
- # Admin? : <%= check_box_tag "person[admin]", "1", @person.company.admin? %>
203
- # <%= f.submit %>
204
- # <% end %>
205
- #
206
- # This also works for the methods in FormOptionsHelper and DateHelper that
207
- # are designed to work with an object as base, like
208
- # FormOptionsHelper#collection_select and DateHelper#datetime_select.
209
- #
210
- # === #form_for with a model object
211
- #
212
- # In the examples above, the object to be created or edited was
213
- # represented by a symbol passed to +form_for+, and we noted that
214
- # a string can also be used equivalently. It is also possible, however,
215
- # to pass a model object itself to +form_for+. For example, if <tt>@post</tt>
216
- # is an existing record you wish to edit, you can create the form using
217
- #
218
- # <%= form_for @post do |f| %>
219
- # ...
220
- # <% end %>
221
- #
222
- # This behaves in almost the same way as outlined previously, with a
223
- # couple of small exceptions. First, the prefix used to name the input
224
- # elements within the form (hence the key that denotes them in the +params+
225
- # hash) is actually derived from the object's _class_, e.g. <tt>params[:post]</tt>
226
- # if the object's class is +Post+. However, this can be overwritten using
227
- # the <tt>:as</tt> option, e.g. -
228
- #
229
- # <%= form_for(@person, as: :client) do |f| %>
230
- # ...
231
- # <% end %>
232
- #
233
- # would result in <tt>params[:client]</tt>.
234
- #
235
- # Secondly, the field values shown when the form is initially displayed
236
- # are taken from the attributes of the object passed to +form_for+,
237
- # regardless of whether the object is an instance
238
- # variable. So, for example, if we had a _local_ variable +post+
239
- # representing an existing record,
240
- #
241
- # <%= form_for post do |f| %>
242
- # ...
243
- # <% end %>
244
- #
245
- # would produce a form with fields whose initial state reflect the current
246
- # values of the attributes of +post+.
247
- #
248
- # === Resource-oriented style
249
- #
250
- # In the examples just shown, although not indicated explicitly, we still
251
- # need to use the <tt>:url</tt> option in order to specify where the
252
- # form is going to be sent. However, further simplification is possible
253
- # if the record passed to +form_for+ is a _resource_, i.e. it corresponds
254
- # to a set of RESTful routes, e.g. defined using the +resources+ method
255
- # in <tt>config/routes.rb</tt>. In this case Rails will simply infer the
256
- # appropriate URL from the record itself. For example,
257
- #
258
- # <%= form_for @post do |f| %>
259
- # ...
260
- # <% end %>
261
- #
262
- # is then equivalent to something like:
263
- #
264
- # <%= form_for @post, as: :post, url: post_path(@post), method: :patch, html: { class: "edit_post", id: "edit_post_45" } do |f| %>
265
- # ...
266
- # <% end %>
267
- #
268
- # And for a new record
269
- #
270
- # <%= form_for(Post.new) do |f| %>
271
- # ...
272
- # <% end %>
273
- #
274
- # is equivalent to something like:
275
- #
276
- # <%= form_for @post, as: :post, url: posts_path, html: { class: "new_post", id: "new_post" } do |f| %>
277
- # ...
278
- # <% end %>
279
- #
280
- # However you can still overwrite individual conventions, such as:
281
- #
282
- # <%= form_for(@post, url: super_posts_path) do |f| %>
283
- # ...
284
- # <% end %>
285
- #
286
- # You can also set the answer format, like this:
287
- #
288
- # <%= form_for(@post, format: :json) do |f| %>
289
- # ...
290
- # <% end %>
291
- #
292
- # For namespaced routes, like +admin_post_url+:
293
- #
294
- # <%= form_for([:admin, @post]) do |f| %>
295
- # ...
296
- # <% end %>
297
- #
298
- # If your resource has associations defined, for example, you want to add comments
299
- # to the document given that the routes are set correctly:
300
- #
301
- # <%= form_for([@document, @comment]) do |f| %>
302
- # ...
303
- # <% end %>
304
- #
305
- # Where <tt>@document = Document.find(params[:id])</tt> and
306
- # <tt>@comment = Comment.new</tt>.
307
- #
308
- # === Setting the method
309
- #
310
- # You can force the form to use the full array of HTTP verbs by setting
311
- #
312
- # method: (:get|:post|:patch|:put|:delete)
313
- #
314
- # in the options hash. If the verb is not GET or POST, which are natively
315
- # supported by HTML forms, the form will be set to POST and a hidden input
316
- # called _method will carry the intended verb for the server to interpret.
317
- #
318
- # === Unobtrusive JavaScript
319
- #
320
- # Specifying:
321
- #
322
- # remote: true
323
- #
324
- # in the options hash creates a form that will allow the unobtrusive JavaScript drivers to modify its
325
- # behavior. The expected default behavior is an XMLHttpRequest in the background instead of the regular
326
- # POST arrangement, but ultimately the behavior is the choice of the JavaScript driver implementor.
327
- # Even though it's using JavaScript to serialize the form elements, the form submission will work just like
328
- # a regular submission as viewed by the receiving side (all elements available in <tt>params</tt>).
329
- #
330
- # Example:
331
- #
332
- # <%= form_for(@post, remote: true) do |f| %>
333
- # ...
334
- # <% end %>
335
- #
336
- # The HTML generated for this would be:
337
- #
338
- # <form action='http://www.example.com' method='post' data-remote='true'>
339
- # <input name='_method' type='hidden' value='patch' />
340
- # ...
341
- # </form>
342
- #
343
- # === Setting HTML options
344
- #
345
- # You can set data attributes directly by passing in a data hash, but all other HTML options must be wrapped in
346
- # the HTML key. Example:
347
- #
348
- # <%= form_for(@post, data: { behavior: "autosave" }, html: { name: "go" }) do |f| %>
349
- # ...
350
- # <% end %>
351
- #
352
- # The HTML generated for this would be:
353
- #
354
- # <form action='http://www.example.com' method='post' data-behavior='autosave' name='go'>
355
- # <input name='_method' type='hidden' value='patch' />
356
- # ...
357
- # </form>
358
- #
359
- # === Removing hidden model id's
360
- #
361
- # The form_for method automatically includes the model id as a hidden field in the form.
362
- # This is used to maintain the correlation between the form data and its associated model.
363
- # Some ORM systems do not use IDs on nested models so in this case you want to be able
364
- # to disable the hidden id.
365
- #
366
- # In the following example the Post model has many Comments stored within it in a NoSQL database,
367
- # thus there is no primary key for comments.
368
- #
369
- # Example:
370
- #
371
- # <%= form_for(@post) do |f| %>
372
- # <%= f.fields_for(:comments, include_id: false) do |cf| %>
373
- # ...
374
- # <% end %>
375
- # <% end %>
376
- #
377
- # === Customized form builders
378
- #
379
- # You can also build forms using a customized FormBuilder class. Subclass
380
- # FormBuilder and override or define some more helpers, then use your
381
- # custom builder. For example, let's say you made a helper to
382
- # automatically add labels to form inputs.
383
- #
384
- # <%= form_for @person, url: { action: "create" }, builder: LabellingFormBuilder do |f| %>
385
- # <%= f.text_field :first_name %>
386
- # <%= f.text_field :last_name %>
387
- # <%= f.text_area :biography %>
388
- # <%= f.check_box :admin %>
389
- # <%= f.submit %>
390
- # <% end %>
391
- #
392
- # In this case, if you use this:
393
- #
394
- # <%= render f %>
395
- #
396
- # The rendered template is <tt>people/_labelling_form</tt> and the local
397
- # variable referencing the form builder is called
398
- # <tt>labelling_form</tt>.
399
- #
400
- # The custom FormBuilder class is automatically merged with the options
401
- # of a nested fields_for call, unless it's explicitly set.
402
- #
403
- # In many cases you will want to wrap the above in another helper, so you
404
- # could do something like the following:
405
- #
406
- # def labelled_form_for(record_or_name_or_array, *args, &block)
407
- # options = args.extract_options!
408
- # form_for(record_or_name_or_array, *(args << options.merge(builder: LabellingFormBuilder)), &block)
409
- # end
410
- #
411
- # If you don't need to attach a form to a model instance, then check out
412
- # FormTagHelper#form_tag.
413
- #
414
- # === Form to external resources
415
- #
416
- # When you build forms to external resources sometimes you need to set an authenticity token or just render a form
417
- # without it, for example when you submit data to a payment gateway number and types of fields could be limited.
418
- #
419
- # To set an authenticity token you need to pass an <tt>:authenticity_token</tt> parameter
420
- #
421
- # <%= form_for @invoice, url: external_url, authenticity_token: 'external_token' do |f| %>
422
- # ...
423
- # <% end %>
424
- #
425
- # If you don't want to an authenticity token field be rendered at all just pass <tt>false</tt>:
426
- #
427
- # <%= form_for @invoice, url: external_url, authenticity_token: false do |f| %>
428
- # ...
429
- # <% end %>
430
- def form_for(record, options = {}, &block)
431
- raise ArgumentError, "Missing block" unless block_given?
432
- html_options = options[:html] ||= {}
433
-
434
- case record
435
- when String, Symbol
436
- object_name = record
437
- object = nil
438
- else
439
- object = record.is_a?(Array) ? record.last : record
440
- raise ArgumentError, "First argument in form cannot contain nil or be empty" unless object
441
- object_name = options[:as] || model_name_from_record_or_class(object).param_key
442
- apply_form_for_options!(record, object, options)
443
- end
444
-
445
- html_options[:data] = options.delete(:data) if options.has_key?(:data)
446
- html_options[:remote] = options.delete(:remote) if options.has_key?(:remote)
447
- html_options[:method] = options.delete(:method) if options.has_key?(:method)
448
- html_options[:enforce_utf8] = options.delete(:enforce_utf8) if options.has_key?(:enforce_utf8)
449
- html_options[:authenticity_token] = options.delete(:authenticity_token)
450
-
451
- builder = instantiate_builder(object_name, object, options)
452
- output = capture(builder, &block)
453
- html_options[:multipart] ||= builder.multipart?
454
-
455
- html_options = html_options_for_form(options[:url] || {}, html_options)
456
- form_tag_with_body(html_options, output)
457
- end
458
-
459
- def apply_form_for_options!(record, object, options) #:nodoc:
460
- object = convert_to_model(object)
461
-
462
- as = options[:as]
463
- namespace = options[:namespace]
464
- action, method = object.respond_to?(:persisted?) && object.persisted? ? [:edit, :patch] : [:new, :post]
465
- options[:html].reverse_merge!(
466
- class: as ? "#{action}_#{as}" : dom_class(object, action),
467
- id: (as ? [namespace, action, as] : [namespace, dom_id(object, action)]).compact.join("_").presence,
468
- method: method
469
- )
470
-
471
- options[:url] ||= if options.key?(:format)
472
- polymorphic_path(record, format: options.delete(:format))
473
- else
474
- polymorphic_path(record, {})
475
- end
476
- end
477
- private :apply_form_for_options!
478
-
479
- mattr_accessor :form_with_generates_remote_forms, default: true
480
-
481
- mattr_accessor :form_with_generates_ids, default: false
482
-
483
- # Creates a form tag based on mixing URLs, scopes, or models.
484
- #
485
- # # Using just a URL:
486
- # <%= form_with url: posts_path do |form| %>
487
- # <%= form.text_field :title %>
488
- # <% end %>
489
- # # =>
490
- # <form action="/posts" method="post" data-remote="true">
491
- # <input type="text" name="title">
492
- # </form>
493
- #
494
- # # Adding a scope prefixes the input field names:
495
- # <%= form_with scope: :post, url: posts_path do |form| %>
496
- # <%= form.text_field :title %>
497
- # <% end %>
498
- # # =>
499
- # <form action="/posts" method="post" data-remote="true">
500
- # <input type="text" name="post[title]">
501
- # </form>
502
- #
503
- # # Using a model infers both the URL and scope:
504
- # <%= form_with model: Post.new do |form| %>
505
- # <%= form.text_field :title %>
506
- # <% end %>
507
- # # =>
508
- # <form action="/posts" method="post" data-remote="true">
509
- # <input type="text" name="post[title]">
510
- # </form>
511
- #
512
- # # An existing model makes an update form and fills out field values:
513
- # <%= form_with model: Post.first do |form| %>
514
- # <%= form.text_field :title %>
515
- # <% end %>
516
- # # =>
517
- # <form action="/posts/1" method="post" data-remote="true">
518
- # <input type="hidden" name="_method" value="patch">
519
- # <input type="text" name="post[title]" value="<the title of the post>">
520
- # </form>
521
- #
522
- # # Though the fields don't have to correspond to model attributes:
523
- # <%= form_with model: Cat.new do |form| %>
524
- # <%= form.text_field :cats_dont_have_gills %>
525
- # <%= form.text_field :but_in_forms_they_can %>
526
- # <% end %>
527
- # # =>
528
- # <form action="/cats" method="post" data-remote="true">
529
- # <input type="text" name="cat[cats_dont_have_gills]">
530
- # <input type="text" name="cat[but_in_forms_they_can]">
531
- # </form>
532
- #
533
- # The parameters in the forms are accessible in controllers according to
534
- # their name nesting. So inputs named +title+ and <tt>post[title]</tt> are
535
- # accessible as <tt>params[:title]</tt> and <tt>params[:post][:title]</tt>
536
- # respectively.
537
- #
538
- # By default +form_with+ attaches the <tt>data-remote</tt> attribute
539
- # submitting the form via an XMLHTTPRequest in the background if an
540
- # Unobtrusive JavaScript driver, like rails-ujs, is used. See the
541
- # <tt>:local</tt> option for more.
542
- #
543
- # For ease of comparison the examples above left out the submit button,
544
- # as well as the auto generated hidden fields that enable UTF-8 support
545
- # and adds an authenticity token needed for cross site request forgery
546
- # protection.
547
- #
548
- # === Resource-oriented style
549
- #
550
- # In many of the examples just shown, the +:model+ passed to +form_with+
551
- # is a _resource_. It corresponds to a set of RESTful routes, most likely
552
- # defined via +resources+ in <tt>config/routes.rb</tt>.
553
- #
554
- # So when passing such a model record, Rails infers the URL and method.
555
- #
556
- # <%= form_with model: @post do |form| %>
557
- # ...
558
- # <% end %>
559
- #
560
- # is then equivalent to something like:
561
- #
562
- # <%= form_with scope: :post, url: post_path(@post), method: :patch do |form| %>
563
- # ...
564
- # <% end %>
565
- #
566
- # And for a new record
567
- #
568
- # <%= form_with model: Post.new do |form| %>
569
- # ...
570
- # <% end %>
571
- #
572
- # is equivalent to something like:
573
- #
574
- # <%= form_with scope: :post, url: posts_path do |form| %>
575
- # ...
576
- # <% end %>
577
- #
578
- # ==== +form_with+ options
579
- #
580
- # * <tt>:url</tt> - The URL the form submits to. Akin to values passed to
581
- # +url_for+ or +link_to+. For example, you may use a named route
582
- # directly. When a <tt>:scope</tt> is passed without a <tt>:url</tt> the
583
- # form just submits to the current URL.
584
- # * <tt>:method</tt> - The method to use when submitting the form, usually
585
- # either "get" or "post". If "patch", "put", "delete", or another verb
586
- # is used, a hidden input named <tt>_method</tt> is added to
587
- # simulate the verb over post.
588
- # * <tt>:format</tt> - The format of the route the form submits to.
589
- # Useful when submitting to another resource type, like <tt>:json</tt>.
590
- # Skipped if a <tt>:url</tt> is passed.
591
- # * <tt>:scope</tt> - The scope to prefix input field names with and
592
- # thereby how the submitted parameters are grouped in controllers.
593
- # * <tt>:model</tt> - A model object to infer the <tt>:url</tt> and
594
- # <tt>:scope</tt> by, plus fill out input field values.
595
- # So if a +title+ attribute is set to "Ahoy!" then a +title+ input
596
- # field's value would be "Ahoy!".
597
- # If the model is a new record a create form is generated, if an
598
- # existing record, however, an update form is generated.
599
- # Pass <tt>:scope</tt> or <tt>:url</tt> to override the defaults.
600
- # E.g. turn <tt>params[:post]</tt> into <tt>params[:article]</tt>.
601
- # * <tt>:authenticity_token</tt> - Authenticity token to use in the form.
602
- # Override with a custom authenticity token or pass <tt>false</tt> to
603
- # skip the authenticity token field altogether.
604
- # Useful when submitting to an external resource like a payment gateway
605
- # that might limit the valid fields.
606
- # Remote forms may omit the embedded authenticity token by setting
607
- # <tt>config.action_view.embed_authenticity_token_in_remote_forms = false</tt>.
608
- # This is helpful when fragment-caching the form. Remote forms
609
- # get the authenticity token from the <tt>meta</tt> tag, so embedding is
610
- # unnecessary unless you support browsers without JavaScript.
611
- # * <tt>:local</tt> - By default form submits are remote and unobtrusive XHRs.
612
- # Disable remote submits with <tt>local: true</tt>.
613
- # * <tt>:skip_enforcing_utf8</tt> - By default a hidden field named +utf8+
614
- # is output to enforce UTF-8 submits. Set to true to skip the field.
615
- # * <tt>:builder</tt> - Override the object used to build the form.
616
- # * <tt>:id</tt> - Optional HTML id attribute.
617
- # * <tt>:class</tt> - Optional HTML class attribute.
618
- # * <tt>:data</tt> - Optional HTML data attributes.
619
- # * <tt>:html</tt> - Other optional HTML attributes for the form tag.
620
- #
621
- # === Examples
622
- #
623
- # When not passing a block, +form_with+ just generates an opening form tag.
624
- #
625
- # <%= form_with(model: @post, url: super_posts_path) %>
626
- # <%= form_with(model: @post, scope: :article) %>
627
- # <%= form_with(model: @post, format: :json) %>
628
- # <%= form_with(model: @post, authenticity_token: false) %> # Disables the token.
629
- #
630
- # For namespaced routes, like +admin_post_url+:
631
- #
632
- # <%= form_with(model: [ :admin, @post ]) do |form| %>
633
- # ...
634
- # <% end %>
635
- #
636
- # If your resource has associations defined, for example, you want to add comments
637
- # to the document given that the routes are set correctly:
638
- #
639
- # <%= form_with(model: [ @document, Comment.new ]) do |form| %>
640
- # ...
641
- # <% end %>
642
- #
643
- # Where <tt>@document = Document.find(params[:id])</tt>.
644
- #
645
- # === Mixing with other form helpers
646
- #
647
- # While +form_with+ uses a FormBuilder object it's possible to mix and
648
- # match the stand-alone FormHelper methods and methods
649
- # from FormTagHelper:
650
- #
651
- # <%= form_with scope: :person do |form| %>
652
- # <%= form.text_field :first_name %>
653
- # <%= form.text_field :last_name %>
654
- #
655
- # <%= text_area :person, :biography %>
656
- # <%= check_box_tag "person[admin]", "1", @person.company.admin? %>
657
- #
658
- # <%= form.submit %>
659
- # <% end %>
660
- #
661
- # Same goes for the methods in FormOptionsHelper and DateHelper designed
662
- # to work with an object as a base, like
663
- # FormOptionsHelper#collection_select and DateHelper#datetime_select.
664
- #
665
- # === Setting the method
666
- #
667
- # You can force the form to use the full array of HTTP verbs by setting
668
- #
669
- # method: (:get|:post|:patch|:put|:delete)
670
- #
671
- # in the options hash. If the verb is not GET or POST, which are natively
672
- # supported by HTML forms, the form will be set to POST and a hidden input
673
- # called _method will carry the intended verb for the server to interpret.
674
- #
675
- # === Setting HTML options
676
- #
677
- # You can set data attributes directly in a data hash, but HTML options
678
- # besides id and class must be wrapped in an HTML key:
679
- #
680
- # <%= form_with(model: @post, data: { behavior: "autosave" }, html: { name: "go" }) do |form| %>
681
- # ...
682
- # <% end %>
683
- #
684
- # generates
685
- #
686
- # <form action="/posts/123" method="post" data-behavior="autosave" name="go">
687
- # <input name="_method" type="hidden" value="patch" />
688
- # ...
689
- # </form>
690
- #
691
- # === Removing hidden model id's
692
- #
693
- # The +form_with+ method automatically includes the model id as a hidden field in the form.
694
- # This is used to maintain the correlation between the form data and its associated model.
695
- # Some ORM systems do not use IDs on nested models so in this case you want to be able
696
- # to disable the hidden id.
697
- #
698
- # In the following example the Post model has many Comments stored within it in a NoSQL database,
699
- # thus there is no primary key for comments.
700
- #
701
- # <%= form_with(model: @post) do |form| %>
702
- # <%= form.fields(:comments, skip_id: true) do |fields| %>
703
- # ...
704
- # <% end %>
705
- # <% end %>
706
- #
707
- # === Customized form builders
708
- #
709
- # You can also build forms using a customized FormBuilder class. Subclass
710
- # FormBuilder and override or define some more helpers, then use your
711
- # custom builder. For example, let's say you made a helper to
712
- # automatically add labels to form inputs.
713
- #
714
- # <%= form_with model: @person, url: { action: "create" }, builder: LabellingFormBuilder do |form| %>
715
- # <%= form.text_field :first_name %>
716
- # <%= form.text_field :last_name %>
717
- # <%= form.text_area :biography %>
718
- # <%= form.check_box :admin %>
719
- # <%= form.submit %>
720
- # <% end %>
721
- #
722
- # In this case, if you use:
723
- #
724
- # <%= render form %>
725
- #
726
- # The rendered template is <tt>people/_labelling_form</tt> and the local
727
- # variable referencing the form builder is called
728
- # <tt>labelling_form</tt>.
729
- #
730
- # The custom FormBuilder class is automatically merged with the options
731
- # of a nested +fields+ call, unless it's explicitly set.
732
- #
733
- # In many cases you will want to wrap the above in another helper, so you
734
- # could do something like the following:
735
- #
736
- # def labelled_form_with(**options, &block)
737
- # form_with(**options.merge(builder: LabellingFormBuilder), &block)
738
- # end
739
- def form_with(model: nil, scope: nil, url: nil, format: nil, **options)
740
- options[:allow_method_names_outside_object] = true
741
- options[:skip_default_ids] = !form_with_generates_ids
742
-
743
- if model
744
- url ||= polymorphic_path(model, format: format)
745
-
746
- model = model.last if model.is_a?(Array)
747
- scope ||= model_name_from_record_or_class(model).param_key
748
- end
749
-
750
- if block_given?
751
- builder = instantiate_builder(scope, model, options)
752
- output = capture(builder, &Proc.new)
753
- options[:multipart] ||= builder.multipart?
754
-
755
- html_options = html_options_for_form_with(url, model, options)
756
- form_tag_with_body(html_options, output)
757
- else
758
- html_options = html_options_for_form_with(url, model, options)
759
- form_tag_html(html_options)
760
- end
761
- end
762
-
763
- # Creates a scope around a specific model object like form_for, but
764
- # doesn't create the form tags themselves. This makes fields_for suitable
765
- # for specifying additional model objects in the same form.
766
- #
767
- # Although the usage and purpose of +fields_for+ is similar to +form_for+'s,
768
- # its method signature is slightly different. Like +form_for+, it yields
769
- # a FormBuilder object associated with a particular model object to a block,
770
- # and within the block allows methods to be called on the builder to
771
- # generate fields associated with the model object. Fields may reflect
772
- # a model object in two ways - how they are named (hence how submitted
773
- # values appear within the +params+ hash in the controller) and what
774
- # default values are shown when the form the fields appear in is first
775
- # displayed. In order for both of these features to be specified independently,
776
- # both an object name (represented by either a symbol or string) and the
777
- # object itself can be passed to the method separately -
778
- #
779
- # <%= form_for @person do |person_form| %>
780
- # First name: <%= person_form.text_field :first_name %>
781
- # Last name : <%= person_form.text_field :last_name %>
782
- #
783
- # <%= fields_for :permission, @person.permission do |permission_fields| %>
784
- # Admin? : <%= permission_fields.check_box :admin %>
785
- # <% end %>
786
- #
787
- # <%= person_form.submit %>
788
- # <% end %>
789
- #
790
- # In this case, the checkbox field will be represented by an HTML +input+
791
- # tag with the +name+ attribute <tt>permission[admin]</tt>, and the submitted
792
- # value will appear in the controller as <tt>params[:permission][:admin]</tt>.
793
- # If <tt>@person.permission</tt> is an existing record with an attribute
794
- # +admin+, the initial state of the checkbox when first displayed will
795
- # reflect the value of <tt>@person.permission.admin</tt>.
796
- #
797
- # Often this can be simplified by passing just the name of the model
798
- # object to +fields_for+ -
799
- #
800
- # <%= fields_for :permission do |permission_fields| %>
801
- # Admin?: <%= permission_fields.check_box :admin %>
802
- # <% end %>
803
- #
804
- # ...in which case, if <tt>:permission</tt> also happens to be the name of an
805
- # instance variable <tt>@permission</tt>, the initial state of the input
806
- # field will reflect the value of that variable's attribute <tt>@permission.admin</tt>.
807
- #
808
- # Alternatively, you can pass just the model object itself (if the first
809
- # argument isn't a string or symbol +fields_for+ will realize that the
810
- # name has been omitted) -
811
- #
812
- # <%= fields_for @person.permission do |permission_fields| %>
813
- # Admin?: <%= permission_fields.check_box :admin %>
814
- # <% end %>
815
- #
816
- # and +fields_for+ will derive the required name of the field from the
817
- # _class_ of the model object, e.g. if <tt>@person.permission</tt>, is
818
- # of class +Permission+, the field will still be named <tt>permission[admin]</tt>.
819
- #
820
- # Note: This also works for the methods in FormOptionsHelper and
821
- # DateHelper that are designed to work with an object as base, like
822
- # FormOptionsHelper#collection_select and DateHelper#datetime_select.
823
- #
824
- # === Nested Attributes Examples
825
- #
826
- # When the object belonging to the current scope has a nested attribute
827
- # writer for a certain attribute, fields_for will yield a new scope
828
- # for that attribute. This allows you to create forms that set or change
829
- # the attributes of a parent object and its associations in one go.
830
- #
831
- # Nested attribute writers are normal setter methods named after an
832
- # association. The most common way of defining these writers is either
833
- # with +accepts_nested_attributes_for+ in a model definition or by
834
- # defining a method with the proper name. For example: the attribute
835
- # writer for the association <tt>:address</tt> is called
836
- # <tt>address_attributes=</tt>.
837
- #
838
- # Whether a one-to-one or one-to-many style form builder will be yielded
839
- # depends on whether the normal reader method returns a _single_ object
840
- # or an _array_ of objects.
841
- #
842
- # ==== One-to-one
843
- #
844
- # Consider a Person class which returns a _single_ Address from the
845
- # <tt>address</tt> reader method and responds to the
846
- # <tt>address_attributes=</tt> writer method:
847
- #
848
- # class Person
849
- # def address
850
- # @address
851
- # end
852
- #
853
- # def address_attributes=(attributes)
854
- # # Process the attributes hash
855
- # end
856
- # end
857
- #
858
- # This model can now be used with a nested fields_for, like so:
859
- #
860
- # <%= form_for @person do |person_form| %>
861
- # ...
862
- # <%= person_form.fields_for :address do |address_fields| %>
863
- # Street : <%= address_fields.text_field :street %>
864
- # Zip code: <%= address_fields.text_field :zip_code %>
865
- # <% end %>
866
- # ...
867
- # <% end %>
868
- #
869
- # When address is already an association on a Person you can use
870
- # +accepts_nested_attributes_for+ to define the writer method for you:
871
- #
872
- # class Person < ActiveRecord::Base
873
- # has_one :address
874
- # accepts_nested_attributes_for :address
875
- # end
876
- #
877
- # If you want to destroy the associated model through the form, you have
878
- # to enable it first using the <tt>:allow_destroy</tt> option for
879
- # +accepts_nested_attributes_for+:
880
- #
881
- # class Person < ActiveRecord::Base
882
- # has_one :address
883
- # accepts_nested_attributes_for :address, allow_destroy: true
884
- # end
885
- #
886
- # Now, when you use a form element with the <tt>_destroy</tt> parameter,
887
- # with a value that evaluates to +true+, you will destroy the associated
888
- # model (eg. 1, '1', true, or 'true'):
889
- #
890
- # <%= form_for @person do |person_form| %>
891
- # ...
892
- # <%= person_form.fields_for :address do |address_fields| %>
893
- # ...
894
- # Delete: <%= address_fields.check_box :_destroy %>
895
- # <% end %>
896
- # ...
897
- # <% end %>
898
- #
899
- # ==== One-to-many
900
- #
901
- # Consider a Person class which returns an _array_ of Project instances
902
- # from the <tt>projects</tt> reader method and responds to the
903
- # <tt>projects_attributes=</tt> writer method:
904
- #
905
- # class Person
906
- # def projects
907
- # [@project1, @project2]
908
- # end
909
- #
910
- # def projects_attributes=(attributes)
911
- # # Process the attributes hash
912
- # end
913
- # end
914
- #
915
- # Note that the <tt>projects_attributes=</tt> writer method is in fact
916
- # required for fields_for to correctly identify <tt>:projects</tt> as a
917
- # collection, and the correct indices to be set in the form markup.
918
- #
919
- # When projects is already an association on Person you can use
920
- # +accepts_nested_attributes_for+ to define the writer method for you:
921
- #
922
- # class Person < ActiveRecord::Base
923
- # has_many :projects
924
- # accepts_nested_attributes_for :projects
925
- # end
926
- #
927
- # This model can now be used with a nested fields_for. The block given to
928
- # the nested fields_for call will be repeated for each instance in the
929
- # collection:
930
- #
931
- # <%= form_for @person do |person_form| %>
932
- # ...
933
- # <%= person_form.fields_for :projects do |project_fields| %>
934
- # <% if project_fields.object.active? %>
935
- # Name: <%= project_fields.text_field :name %>
936
- # <% end %>
937
- # <% end %>
938
- # ...
939
- # <% end %>
940
- #
941
- # It's also possible to specify the instance to be used:
942
- #
943
- # <%= form_for @person do |person_form| %>
944
- # ...
945
- # <% @person.projects.each do |project| %>
946
- # <% if project.active? %>
947
- # <%= person_form.fields_for :projects, project do |project_fields| %>
948
- # Name: <%= project_fields.text_field :name %>
949
- # <% end %>
950
- # <% end %>
951
- # <% end %>
952
- # ...
953
- # <% end %>
954
- #
955
- # Or a collection to be used:
956
- #
957
- # <%= form_for @person do |person_form| %>
958
- # ...
959
- # <%= person_form.fields_for :projects, @active_projects do |project_fields| %>
960
- # Name: <%= project_fields.text_field :name %>
961
- # <% end %>
962
- # ...
963
- # <% end %>
964
- #
965
- # If you want to destroy any of the associated models through the
966
- # form, you have to enable it first using the <tt>:allow_destroy</tt>
967
- # option for +accepts_nested_attributes_for+:
968
- #
969
- # class Person < ActiveRecord::Base
970
- # has_many :projects
971
- # accepts_nested_attributes_for :projects, allow_destroy: true
972
- # end
973
- #
974
- # This will allow you to specify which models to destroy in the
975
- # attributes hash by adding a form element for the <tt>_destroy</tt>
976
- # parameter with a value that evaluates to +true+
977
- # (eg. 1, '1', true, or 'true'):
978
- #
979
- # <%= form_for @person do |person_form| %>
980
- # ...
981
- # <%= person_form.fields_for :projects do |project_fields| %>
982
- # Delete: <%= project_fields.check_box :_destroy %>
983
- # <% end %>
984
- # ...
985
- # <% end %>
986
- #
987
- # When a collection is used you might want to know the index of each
988
- # object into the array. For this purpose, the <tt>index</tt> method
989
- # is available in the FormBuilder object.
990
- #
991
- # <%= form_for @person do |person_form| %>
992
- # ...
993
- # <%= person_form.fields_for :projects do |project_fields| %>
994
- # Project #<%= project_fields.index %>
995
- # ...
996
- # <% end %>
997
- # ...
998
- # <% end %>
999
- #
1000
- # Note that fields_for will automatically generate a hidden field
1001
- # to store the ID of the record. There are circumstances where this
1002
- # hidden field is not needed and you can pass <tt>include_id: false</tt>
1003
- # to prevent fields_for from rendering it automatically.
1004
- def fields_for(record_name, record_object = nil, options = {}, &block)
1005
- builder = instantiate_builder(record_name, record_object, options)
1006
- capture(builder, &block)
1007
- end
1008
-
1009
- # Scopes input fields with either an explicit scope or model.
1010
- # Like +form_with+ does with <tt>:scope</tt> or <tt>:model</tt>,
1011
- # except it doesn't output the form tags.
1012
- #
1013
- # # Using a scope prefixes the input field names:
1014
- # <%= fields :comment do |fields| %>
1015
- # <%= fields.text_field :body %>
1016
- # <% end %>
1017
- # # => <input type="text" name="comment[body]">
1018
- #
1019
- # # Using a model infers the scope and assigns field values:
1020
- # <%= fields model: Comment.new(body: "full bodied") do |fields| %>
1021
- # <%= fields.text_field :body %>
1022
- # <% end %>
1023
- # # => <input type="text" name="comment[body]" value="full bodied">
1024
- #
1025
- # # Using +fields+ with +form_with+:
1026
- # <%= form_with model: @post do |form| %>
1027
- # <%= form.text_field :title %>
1028
- #
1029
- # <%= form.fields :comment do |fields| %>
1030
- # <%= fields.text_field :body %>
1031
- # <% end %>
1032
- # <% end %>
1033
- #
1034
- # Much like +form_with+ a FormBuilder instance associated with the scope
1035
- # or model is yielded, so any generated field names are prefixed with
1036
- # either the passed scope or the scope inferred from the <tt>:model</tt>.
1037
- #
1038
- # === Mixing with other form helpers
1039
- #
1040
- # While +form_with+ uses a FormBuilder object it's possible to mix and
1041
- # match the stand-alone FormHelper methods and methods
1042
- # from FormTagHelper:
1043
- #
1044
- # <%= fields model: @comment do |fields| %>
1045
- # <%= fields.text_field :body %>
1046
- #
1047
- # <%= text_area :commenter, :biography %>
1048
- # <%= check_box_tag "comment[all_caps]", "1", @comment.commenter.hulk_mode? %>
1049
- # <% end %>
1050
- #
1051
- # Same goes for the methods in FormOptionsHelper and DateHelper designed
1052
- # to work with an object as a base, like
1053
- # FormOptionsHelper#collection_select and DateHelper#datetime_select.
1054
- def fields(scope = nil, model: nil, **options, &block)
1055
- options[:allow_method_names_outside_object] = true
1056
- options[:skip_default_ids] = !form_with_generates_ids
1057
-
1058
- if model
1059
- scope ||= model_name_from_record_or_class(model).param_key
1060
- end
1061
-
1062
- builder = instantiate_builder(scope, model, options)
1063
- capture(builder, &block)
1064
- end
1065
-
1066
- # Returns a label tag tailored for labelling an input field for a specified attribute (identified by +method+) on an object
1067
- # assigned to the template (identified by +object+). The text of label will default to the attribute name unless a translation
1068
- # is found in the current I18n locale (through helpers.label.<modelname>.<attribute>) or you specify it explicitly.
1069
- # Additional options on the label tag can be passed as a hash with +options+. These options will be tagged
1070
- # onto the HTML as an HTML element attribute as in the example shown, except for the <tt>:value</tt> option, which is designed to
1071
- # target labels for radio_button tags (where the value is used in the ID of the input tag).
1072
- #
1073
- # ==== Examples
1074
- # label(:post, :title)
1075
- # # => <label for="post_title">Title</label>
1076
- #
1077
- # You can localize your labels based on model and attribute names.
1078
- # For example you can define the following in your locale (e.g. en.yml)
1079
- #
1080
- # helpers:
1081
- # label:
1082
- # post:
1083
- # body: "Write your entire text here"
1084
- #
1085
- # Which then will result in
1086
- #
1087
- # label(:post, :body)
1088
- # # => <label for="post_body">Write your entire text here</label>
1089
- #
1090
- # Localization can also be based purely on the translation of the attribute-name
1091
- # (if you are using ActiveRecord):
1092
- #
1093
- # activerecord:
1094
- # attributes:
1095
- # post:
1096
- # cost: "Total cost"
1097
- #
1098
- # label(:post, :cost)
1099
- # # => <label for="post_cost">Total cost</label>
1100
- #
1101
- # label(:post, :title, "A short title")
1102
- # # => <label for="post_title">A short title</label>
1103
- #
1104
- # label(:post, :title, "A short title", class: "title_label")
1105
- # # => <label for="post_title" class="title_label">A short title</label>
1106
- #
1107
- # label(:post, :privacy, "Public Post", value: "public")
1108
- # # => <label for="post_privacy_public">Public Post</label>
1109
- #
1110
- # label(:post, :terms) do
1111
- # raw('Accept <a href="/terms">Terms</a>.')
1112
- # end
1113
- # # => <label for="post_terms">Accept <a href="/terms">Terms</a>.</label>
1114
- def label(object_name, method, content_or_options = nil, options = nil, &block)
1115
- Tags::Label.new(object_name, method, self, content_or_options, options).render(&block)
1116
- end
1117
-
1118
- # Returns an input tag of the "text" type tailored for accessing a specified attribute (identified by +method+) on an object
1119
- # assigned to the template (identified by +object+). Additional options on the input tag can be passed as a
1120
- # hash with +options+. These options will be tagged onto the HTML as an HTML element attribute as in the example
1121
- # shown.
1122
- #
1123
- # ==== Examples
1124
- # text_field(:post, :title, size: 20)
1125
- # # => <input type="text" id="post_title" name="post[title]" size="20" value="#{@post.title}" />
1126
- #
1127
- # text_field(:post, :title, class: "create_input")
1128
- # # => <input type="text" id="post_title" name="post[title]" value="#{@post.title}" class="create_input" />
1129
- #
1130
- # text_field(:session, :user, onchange: "if ($('#session_user').val() === 'admin') { alert('Your login cannot be admin!'); }")
1131
- # # => <input type="text" id="session_user" name="session[user]" value="#{@session.user}" onchange="if ($('#session_user').val() === 'admin') { alert('Your login cannot be admin!'); }"/>
1132
- #
1133
- # text_field(:snippet, :code, size: 20, class: 'code_input')
1134
- # # => <input type="text" id="snippet_code" name="snippet[code]" size="20" value="#{@snippet.code}" class="code_input" />
1135
- def text_field(object_name, method, options = {})
1136
- Tags::TextField.new(object_name, method, self, options).render
1137
- end
1138
-
1139
- # Returns an input tag of the "password" type tailored for accessing a specified attribute (identified by +method+) on an object
1140
- # assigned to the template (identified by +object+). Additional options on the input tag can be passed as a
1141
- # hash with +options+. These options will be tagged onto the HTML as an HTML element attribute as in the example
1142
- # shown. For security reasons this field is blank by default; pass in a value via +options+ if this is not desired.
1143
- #
1144
- # ==== Examples
1145
- # password_field(:login, :pass, size: 20)
1146
- # # => <input type="password" id="login_pass" name="login[pass]" size="20" />
1147
- #
1148
- # password_field(:account, :secret, class: "form_input", value: @account.secret)
1149
- # # => <input type="password" id="account_secret" name="account[secret]" value="#{@account.secret}" class="form_input" />
1150
- #
1151
- # password_field(:user, :password, onchange: "if ($('#user_password').val().length > 30) { alert('Your password needs to be shorter!'); }")
1152
- # # => <input type="password" id="user_password" name="user[password]" onchange="if ($('#user_password').val().length > 30) { alert('Your password needs to be shorter!'); }"/>
1153
- #
1154
- # password_field(:account, :pin, size: 20, class: 'form_input')
1155
- # # => <input type="password" id="account_pin" name="account[pin]" size="20" class="form_input" />
1156
- def password_field(object_name, method, options = {})
1157
- Tags::PasswordField.new(object_name, method, self, options).render
1158
- end
1159
-
1160
- # Returns a hidden input tag tailored for accessing a specified attribute (identified by +method+) on an object
1161
- # assigned to the template (identified by +object+). Additional options on the input tag can be passed as a
1162
- # hash with +options+. These options will be tagged onto the HTML as an HTML element attribute as in the example
1163
- # shown.
1164
- #
1165
- # ==== Examples
1166
- # hidden_field(:signup, :pass_confirm)
1167
- # # => <input type="hidden" id="signup_pass_confirm" name="signup[pass_confirm]" value="#{@signup.pass_confirm}" />
1168
- #
1169
- # hidden_field(:post, :tag_list)
1170
- # # => <input type="hidden" id="post_tag_list" name="post[tag_list]" value="#{@post.tag_list}" />
1171
- #
1172
- # hidden_field(:user, :token)
1173
- # # => <input type="hidden" id="user_token" name="user[token]" value="#{@user.token}" />
1174
- def hidden_field(object_name, method, options = {})
1175
- Tags::HiddenField.new(object_name, method, self, options).render
1176
- end
1177
-
1178
- # Returns a file upload input tag tailored for accessing a specified attribute (identified by +method+) on an object
1179
- # assigned to the template (identified by +object+). Additional options on the input tag can be passed as a
1180
- # hash with +options+. These options will be tagged onto the HTML as an HTML element attribute as in the example
1181
- # shown.
1182
- #
1183
- # Using this method inside a +form_for+ block will set the enclosing form's encoding to <tt>multipart/form-data</tt>.
1184
- #
1185
- # ==== Options
1186
- # * Creates standard HTML attributes for the tag.
1187
- # * <tt>:disabled</tt> - If set to true, the user will not be able to use this input.
1188
- # * <tt>:multiple</tt> - If set to true, *in most updated browsers* the user will be allowed to select multiple files.
1189
- # * <tt>:accept</tt> - If set to one or multiple mime-types, the user will be suggested a filter when choosing a file. You still need to set up model validations.
1190
- #
1191
- # ==== Examples
1192
- # file_field(:user, :avatar)
1193
- # # => <input type="file" id="user_avatar" name="user[avatar]" />
1194
- #
1195
- # file_field(:post, :image, multiple: true)
1196
- # # => <input type="file" id="post_image" name="post[image][]" multiple="multiple" />
1197
- #
1198
- # file_field(:post, :attached, accept: 'text/html')
1199
- # # => <input accept="text/html" type="file" id="post_attached" name="post[attached]" />
1200
- #
1201
- # file_field(:post, :image, accept: 'image/png,image/gif,image/jpeg')
1202
- # # => <input type="file" id="post_image" name="post[image]" accept="image/png,image/gif,image/jpeg" />
1203
- #
1204
- # file_field(:attachment, :file, class: 'file_input')
1205
- # # => <input type="file" id="attachment_file" name="attachment[file]" class="file_input" />
1206
- def file_field(object_name, method, options = {})
1207
- Tags::FileField.new(object_name, method, self, convert_direct_upload_option_to_url(options.dup)).render
1208
- end
1209
-
1210
- # Returns a textarea opening and closing tag set tailored for accessing a specified attribute (identified by +method+)
1211
- # on an object assigned to the template (identified by +object+). Additional options on the input tag can be passed as a
1212
- # hash with +options+.
1213
- #
1214
- # ==== Examples
1215
- # text_area(:post, :body, cols: 20, rows: 40)
1216
- # # => <textarea cols="20" rows="40" id="post_body" name="post[body]">
1217
- # # #{@post.body}
1218
- # # </textarea>
1219
- #
1220
- # text_area(:comment, :text, size: "20x30")
1221
- # # => <textarea cols="20" rows="30" id="comment_text" name="comment[text]">
1222
- # # #{@comment.text}
1223
- # # </textarea>
1224
- #
1225
- # text_area(:application, :notes, cols: 40, rows: 15, class: 'app_input')
1226
- # # => <textarea cols="40" rows="15" id="application_notes" name="application[notes]" class="app_input">
1227
- # # #{@application.notes}
1228
- # # </textarea>
1229
- #
1230
- # text_area(:entry, :body, size: "20x20", disabled: 'disabled')
1231
- # # => <textarea cols="20" rows="20" id="entry_body" name="entry[body]" disabled="disabled">
1232
- # # #{@entry.body}
1233
- # # </textarea>
1234
- def text_area(object_name, method, options = {})
1235
- Tags::TextArea.new(object_name, method, self, options).render
1236
- end
1237
-
1238
- # Returns a checkbox tag tailored for accessing a specified attribute (identified by +method+) on an object
1239
- # assigned to the template (identified by +object+). This object must be an instance object (@object) and not a local object.
1240
- # It's intended that +method+ returns an integer and if that integer is above zero, then the checkbox is checked.
1241
- # Additional options on the input tag can be passed as a hash with +options+. The +checked_value+ defaults to 1
1242
- # while the default +unchecked_value+ is set to 0 which is convenient for boolean values.
1243
- #
1244
- # ==== Gotcha
1245
- #
1246
- # The HTML specification says unchecked check boxes are not successful, and
1247
- # thus web browsers do not send them. Unfortunately this introduces a gotcha:
1248
- # if an +Invoice+ model has a +paid+ flag, and in the form that edits a paid
1249
- # invoice the user unchecks its check box, no +paid+ parameter is sent. So,
1250
- # any mass-assignment idiom like
1251
- #
1252
- # @invoice.update(params[:invoice])
1253
- #
1254
- # wouldn't update the flag.
1255
- #
1256
- # To prevent this the helper generates an auxiliary hidden field before
1257
- # the very check box. The hidden field has the same name and its
1258
- # attributes mimic an unchecked check box.
1259
- #
1260
- # This way, the client either sends only the hidden field (representing
1261
- # the check box is unchecked), or both fields. Since the HTML specification
1262
- # says key/value pairs have to be sent in the same order they appear in the
1263
- # form, and parameters extraction gets the last occurrence of any repeated
1264
- # key in the query string, that works for ordinary forms.
1265
- #
1266
- # Unfortunately that workaround does not work when the check box goes
1267
- # within an array-like parameter, as in
1268
- #
1269
- # <%= fields_for "project[invoice_attributes][]", invoice, index: nil do |form| %>
1270
- # <%= form.check_box :paid %>
1271
- # ...
1272
- # <% end %>
1273
- #
1274
- # because parameter name repetition is precisely what Rails seeks to distinguish
1275
- # the elements of the array. For each item with a checked check box you
1276
- # get an extra ghost item with only that attribute, assigned to "0".
1277
- #
1278
- # In that case it is preferable to either use +check_box_tag+ or to use
1279
- # hashes instead of arrays.
1280
- #
1281
- # # Let's say that @post.validated? is 1:
1282
- # check_box("post", "validated")
1283
- # # => <input name="post[validated]" type="hidden" value="0" />
1284
- # # <input checked="checked" type="checkbox" id="post_validated" name="post[validated]" value="1" />
1285
- #
1286
- # # Let's say that @puppy.gooddog is "no":
1287
- # check_box("puppy", "gooddog", {}, "yes", "no")
1288
- # # => <input name="puppy[gooddog]" type="hidden" value="no" />
1289
- # # <input type="checkbox" id="puppy_gooddog" name="puppy[gooddog]" value="yes" />
1290
- #
1291
- # check_box("eula", "accepted", { class: 'eula_check' }, "yes", "no")
1292
- # # => <input name="eula[accepted]" type="hidden" value="no" />
1293
- # # <input type="checkbox" class="eula_check" id="eula_accepted" name="eula[accepted]" value="yes" />
1294
- def check_box(object_name, method, options = {}, checked_value = "1", unchecked_value = "0")
1295
- Tags::CheckBox.new(object_name, method, self, checked_value, unchecked_value, options).render
1296
- end
1297
-
1298
- # Returns a radio button tag for accessing a specified attribute (identified by +method+) on an object
1299
- # assigned to the template (identified by +object+). If the current value of +method+ is +tag_value+ the
1300
- # radio button will be checked.
1301
- #
1302
- # To force the radio button to be checked pass <tt>checked: true</tt> in the
1303
- # +options+ hash. You may pass HTML options there as well.
1304
- #
1305
- # # Let's say that @post.category returns "rails":
1306
- # radio_button("post", "category", "rails")
1307
- # radio_button("post", "category", "java")
1308
- # # => <input type="radio" id="post_category_rails" name="post[category]" value="rails" checked="checked" />
1309
- # # <input type="radio" id="post_category_java" name="post[category]" value="java" />
1310
- #
1311
- # # Let's say that @user.receive_newsletter returns "no":
1312
- # radio_button("user", "receive_newsletter", "yes")
1313
- # radio_button("user", "receive_newsletter", "no")
1314
- # # => <input type="radio" id="user_receive_newsletter_yes" name="user[receive_newsletter]" value="yes" />
1315
- # # <input type="radio" id="user_receive_newsletter_no" name="user[receive_newsletter]" value="no" checked="checked" />
1316
- def radio_button(object_name, method, tag_value, options = {})
1317
- Tags::RadioButton.new(object_name, method, self, tag_value, options).render
1318
- end
1319
-
1320
- # Returns a text_field of type "color".
1321
- #
1322
- # color_field("car", "color")
1323
- # # => <input id="car_color" name="car[color]" type="color" value="#000000" />
1324
- def color_field(object_name, method, options = {})
1325
- Tags::ColorField.new(object_name, method, self, options).render
1326
- end
1327
-
1328
- # Returns an input of type "search" for accessing a specified attribute (identified by +method+) on an object
1329
- # assigned to the template (identified by +object_name+). Inputs of type "search" may be styled differently by
1330
- # some browsers.
1331
- #
1332
- # search_field(:user, :name)
1333
- # # => <input id="user_name" name="user[name]" type="search" />
1334
- # search_field(:user, :name, autosave: false)
1335
- # # => <input autosave="false" id="user_name" name="user[name]" type="search" />
1336
- # search_field(:user, :name, results: 3)
1337
- # # => <input id="user_name" name="user[name]" results="3" type="search" />
1338
- # # Assume request.host returns "www.example.com"
1339
- # search_field(:user, :name, autosave: true)
1340
- # # => <input autosave="com.example.www" id="user_name" name="user[name]" results="10" type="search" />
1341
- # search_field(:user, :name, onsearch: true)
1342
- # # => <input id="user_name" incremental="true" name="user[name]" onsearch="true" type="search" />
1343
- # search_field(:user, :name, autosave: false, onsearch: true)
1344
- # # => <input autosave="false" id="user_name" incremental="true" name="user[name]" onsearch="true" type="search" />
1345
- # search_field(:user, :name, autosave: true, onsearch: true)
1346
- # # => <input autosave="com.example.www" id="user_name" incremental="true" name="user[name]" onsearch="true" results="10" type="search" />
1347
- def search_field(object_name, method, options = {})
1348
- Tags::SearchField.new(object_name, method, self, options).render
1349
- end
1350
-
1351
- # Returns a text_field of type "tel".
1352
- #
1353
- # telephone_field("user", "phone")
1354
- # # => <input id="user_phone" name="user[phone]" type="tel" />
1355
- #
1356
- def telephone_field(object_name, method, options = {})
1357
- Tags::TelField.new(object_name, method, self, options).render
1358
- end
1359
- # aliases telephone_field
1360
- alias phone_field telephone_field
1361
-
1362
- # Returns a text_field of type "date".
1363
- #
1364
- # date_field("user", "born_on")
1365
- # # => <input id="user_born_on" name="user[born_on]" type="date" />
1366
- #
1367
- # The default value is generated by trying to call +strftime+ with "%Y-%m-%d"
1368
- # on the object's value, which makes it behave as expected for instances
1369
- # of DateTime and ActiveSupport::TimeWithZone. You can still override that
1370
- # by passing the "value" option explicitly, e.g.
1371
- #
1372
- # @user.born_on = Date.new(1984, 1, 27)
1373
- # date_field("user", "born_on", value: "1984-05-12")
1374
- # # => <input id="user_born_on" name="user[born_on]" type="date" value="1984-05-12" />
1375
- #
1376
- # You can create values for the "min" and "max" attributes by passing
1377
- # instances of Date or Time to the options hash.
1378
- #
1379
- # date_field("user", "born_on", min: Date.today)
1380
- # # => <input id="user_born_on" name="user[born_on]" type="date" min="2014-05-20" />
1381
- #
1382
- # Alternatively, you can pass a String formatted as an ISO8601 date as the
1383
- # values for "min" and "max."
1384
- #
1385
- # date_field("user", "born_on", min: "2014-05-20")
1386
- # # => <input id="user_born_on" name="user[born_on]" type="date" min="2014-05-20" />
1387
- #
1388
- def date_field(object_name, method, options = {})
1389
- Tags::DateField.new(object_name, method, self, options).render
1390
- end
1391
-
1392
- # Returns a text_field of type "time".
1393
- #
1394
- # The default value is generated by trying to call +strftime+ with "%T.%L"
1395
- # on the object's value. It is still possible to override that
1396
- # by passing the "value" option.
1397
- #
1398
- # === Options
1399
- # * Accepts same options as time_field_tag
1400
- #
1401
- # === Example
1402
- # time_field("task", "started_at")
1403
- # # => <input id="task_started_at" name="task[started_at]" type="time" />
1404
- #
1405
- # You can create values for the "min" and "max" attributes by passing
1406
- # instances of Date or Time to the options hash.
1407
- #
1408
- # time_field("task", "started_at", min: Time.now)
1409
- # # => <input id="task_started_at" name="task[started_at]" type="time" min="01:00:00.000" />
1410
- #
1411
- # Alternatively, you can pass a String formatted as an ISO8601 time as the
1412
- # values for "min" and "max."
1413
- #
1414
- # time_field("task", "started_at", min: "01:00:00")
1415
- # # => <input id="task_started_at" name="task[started_at]" type="time" min="01:00:00.000" />
1416
- #
1417
- def time_field(object_name, method, options = {})
1418
- Tags::TimeField.new(object_name, method, self, options).render
1419
- end
1420
-
1421
- # Returns a text_field of type "datetime-local".
1422
- #
1423
- # datetime_field("user", "born_on")
1424
- # # => <input id="user_born_on" name="user[born_on]" type="datetime-local" />
1425
- #
1426
- # The default value is generated by trying to call +strftime+ with "%Y-%m-%dT%T"
1427
- # on the object's value, which makes it behave as expected for instances
1428
- # of DateTime and ActiveSupport::TimeWithZone.
1429
- #
1430
- # @user.born_on = Date.new(1984, 1, 12)
1431
- # datetime_field("user", "born_on")
1432
- # # => <input id="user_born_on" name="user[born_on]" type="datetime-local" value="1984-01-12T00:00:00" />
1433
- #
1434
- # You can create values for the "min" and "max" attributes by passing
1435
- # instances of Date or Time to the options hash.
1436
- #
1437
- # datetime_field("user", "born_on", min: Date.today)
1438
- # # => <input id="user_born_on" name="user[born_on]" type="datetime-local" min="2014-05-20T00:00:00.000" />
1439
- #
1440
- # Alternatively, you can pass a String formatted as an ISO8601 datetime as
1441
- # the values for "min" and "max."
1442
- #
1443
- # datetime_field("user", "born_on", min: "2014-05-20T00:00:00")
1444
- # # => <input id="user_born_on" name="user[born_on]" type="datetime-local" min="2014-05-20T00:00:00.000" />
1445
- #
1446
- def datetime_field(object_name, method, options = {})
1447
- Tags::DatetimeLocalField.new(object_name, method, self, options).render
1448
- end
1449
-
1450
- alias datetime_local_field datetime_field
1451
-
1452
- # Returns a text_field of type "month".
1453
- #
1454
- # month_field("user", "born_on")
1455
- # # => <input id="user_born_on" name="user[born_on]" type="month" />
1456
- #
1457
- # The default value is generated by trying to call +strftime+ with "%Y-%m"
1458
- # on the object's value, which makes it behave as expected for instances
1459
- # of DateTime and ActiveSupport::TimeWithZone.
1460
- #
1461
- # @user.born_on = Date.new(1984, 1, 27)
1462
- # month_field("user", "born_on")
1463
- # # => <input id="user_born_on" name="user[born_on]" type="date" value="1984-01" />
1464
- #
1465
- def month_field(object_name, method, options = {})
1466
- Tags::MonthField.new(object_name, method, self, options).render
1467
- end
1468
-
1469
- # Returns a text_field of type "week".
1470
- #
1471
- # week_field("user", "born_on")
1472
- # # => <input id="user_born_on" name="user[born_on]" type="week" />
1473
- #
1474
- # The default value is generated by trying to call +strftime+ with "%Y-W%W"
1475
- # on the object's value, which makes it behave as expected for instances
1476
- # of DateTime and ActiveSupport::TimeWithZone.
1477
- #
1478
- # @user.born_on = Date.new(1984, 5, 12)
1479
- # week_field("user", "born_on")
1480
- # # => <input id="user_born_on" name="user[born_on]" type="date" value="1984-W19" />
1481
- #
1482
- def week_field(object_name, method, options = {})
1483
- Tags::WeekField.new(object_name, method, self, options).render
1484
- end
1485
-
1486
- # Returns a text_field of type "url".
1487
- #
1488
- # url_field("user", "homepage")
1489
- # # => <input id="user_homepage" name="user[homepage]" type="url" />
1490
- #
1491
- def url_field(object_name, method, options = {})
1492
- Tags::UrlField.new(object_name, method, self, options).render
1493
- end
1494
-
1495
- # Returns a text_field of type "email".
1496
- #
1497
- # email_field("user", "address")
1498
- # # => <input id="user_address" name="user[address]" type="email" />
1499
- #
1500
- def email_field(object_name, method, options = {})
1501
- Tags::EmailField.new(object_name, method, self, options).render
1502
- end
1503
-
1504
- # Returns an input tag of type "number".
1505
- #
1506
- # ==== Options
1507
- # * Accepts same options as number_field_tag
1508
- def number_field(object_name, method, options = {})
1509
- Tags::NumberField.new(object_name, method, self, options).render
1510
- end
1511
-
1512
- # Returns an input tag of type "range".
1513
- #
1514
- # ==== Options
1515
- # * Accepts same options as range_field_tag
1516
- def range_field(object_name, method, options = {})
1517
- Tags::RangeField.new(object_name, method, self, options).render
1518
- end
1519
-
1520
- private
1521
- def html_options_for_form_with(url_for_options = nil, model = nil, html: {}, local: !form_with_generates_remote_forms,
1522
- skip_enforcing_utf8: false, **options)
1523
- html_options = options.slice(:id, :class, :multipart, :method, :data).merge(html)
1524
- html_options[:method] ||= :patch if model.respond_to?(:persisted?) && model.persisted?
1525
- html_options[:enforce_utf8] = !skip_enforcing_utf8
1526
-
1527
- html_options[:enctype] = "multipart/form-data" if html_options.delete(:multipart)
1528
-
1529
- # The following URL is unescaped, this is just a hash of options, and it is the
1530
- # responsibility of the caller to escape all the values.
1531
- html_options[:action] = url_for(url_for_options || {})
1532
- html_options[:"accept-charset"] = "UTF-8"
1533
- html_options[:"data-remote"] = true unless local
1534
-
1535
- html_options[:authenticity_token] = options.delete(:authenticity_token)
1536
-
1537
- if !local && html_options[:authenticity_token].blank?
1538
- html_options[:authenticity_token] = embed_authenticity_token_in_remote_forms
1539
- end
1540
-
1541
- if html_options[:authenticity_token] == true
1542
- # Include the default authenticity_token, which is only generated when it's set to nil,
1543
- # but we needed the true value to override the default of no authenticity_token on data-remote.
1544
- html_options[:authenticity_token] = nil
1545
- end
1546
-
1547
- html_options.stringify_keys!
1548
- end
1549
-
1550
- def instantiate_builder(record_name, record_object, options)
1551
- case record_name
1552
- when String, Symbol
1553
- object = record_object
1554
- object_name = record_name
1555
- else
1556
- object = record_name
1557
- object_name = model_name_from_record_or_class(object).param_key if object
1558
- end
1559
-
1560
- builder = options[:builder] || default_form_builder_class
1561
- builder.new(object_name, object, self, options)
1562
- end
1563
-
1564
- def default_form_builder_class
1565
- builder = default_form_builder || ActionView::Base.default_form_builder
1566
- builder.respond_to?(:constantize) ? builder.constantize : builder
1567
- end
1568
- end
1569
-
1570
- # A +FormBuilder+ object is associated with a particular model object and
1571
- # allows you to generate fields associated with the model object. The
1572
- # +FormBuilder+ object is yielded when using +form_for+ or +fields_for+.
1573
- # For example:
1574
- #
1575
- # <%= form_for @person do |person_form| %>
1576
- # Name: <%= person_form.text_field :name %>
1577
- # Admin: <%= person_form.check_box :admin %>
1578
- # <% end %>
1579
- #
1580
- # In the above block, a +FormBuilder+ object is yielded as the
1581
- # +person_form+ variable. This allows you to generate the +text_field+
1582
- # and +check_box+ fields by specifying their eponymous methods, which
1583
- # modify the underlying template and associates the <tt>@person</tt> model object
1584
- # with the form.
1585
- #
1586
- # The +FormBuilder+ object can be thought of as serving as a proxy for the
1587
- # methods in the +FormHelper+ module. This class, however, allows you to
1588
- # call methods with the model object you are building the form for.
1589
- #
1590
- # You can create your own custom FormBuilder templates by subclassing this
1591
- # class. For example:
1592
- #
1593
- # class MyFormBuilder < ActionView::Helpers::FormBuilder
1594
- # def div_radio_button(method, tag_value, options = {})
1595
- # @template.content_tag(:div,
1596
- # @template.radio_button(
1597
- # @object_name, method, tag_value, objectify_options(options)
1598
- # )
1599
- # )
1600
- # end
1601
- # end
1602
- #
1603
- # The above code creates a new method +div_radio_button+ which wraps a div
1604
- # around the new radio button. Note that when options are passed in, you
1605
- # must call +objectify_options+ in order for the model object to get
1606
- # correctly passed to the method. If +objectify_options+ is not called,
1607
- # then the newly created helper will not be linked back to the model.
1608
- #
1609
- # The +div_radio_button+ code from above can now be used as follows:
1610
- #
1611
- # <%= form_for @person, :builder => MyFormBuilder do |f| %>
1612
- # I am a child: <%= f.div_radio_button(:admin, "child") %>
1613
- # I am an adult: <%= f.div_radio_button(:admin, "adult") %>
1614
- # <% end -%>
1615
- #
1616
- # The standard set of helper methods for form building are located in the
1617
- # +field_helpers+ class attribute.
1618
- class FormBuilder
1619
- include ModelNaming
1620
-
1621
- # The methods which wrap a form helper call.
1622
- class_attribute :field_helpers, default: [
1623
- :fields_for, :fields, :label, :text_field, :password_field,
1624
- :hidden_field, :file_field, :text_area, :check_box,
1625
- :radio_button, :color_field, :search_field,
1626
- :telephone_field, :phone_field, :date_field,
1627
- :time_field, :datetime_field, :datetime_local_field,
1628
- :month_field, :week_field, :url_field, :email_field,
1629
- :number_field, :range_field
1630
- ]
1631
-
1632
- attr_accessor :object_name, :object, :options
1633
-
1634
- attr_reader :multipart, :index
1635
- alias :multipart? :multipart
1636
-
1637
- def multipart=(multipart)
1638
- @multipart = multipart
1639
-
1640
- if parent_builder = @options[:parent_builder]
1641
- parent_builder.multipart = multipart
1642
- end
1643
- end
1644
-
1645
- def self._to_partial_path
1646
- @_to_partial_path ||= name.demodulize.underscore.sub!(/_builder$/, "")
1647
- end
1648
-
1649
- def to_partial_path
1650
- self.class._to_partial_path
1651
- end
1652
-
1653
- def to_model
1654
- self
1655
- end
1656
-
1657
- def initialize(object_name, object, template, options)
1658
- @nested_child_index = {}
1659
- @object_name, @object, @template, @options = object_name, object, template, options
1660
- @default_options = @options ? @options.slice(:index, :namespace, :skip_default_ids, :allow_method_names_outside_object) : {}
1661
- @default_html_options = @default_options.except(:skip_default_ids, :allow_method_names_outside_object)
1662
-
1663
- convert_to_legacy_options(@options)
1664
-
1665
- if @object_name.to_s.match(/\[\]$/)
1666
- if (object ||= @template.instance_variable_get("@#{Regexp.last_match.pre_match}")) && object.respond_to?(:to_param)
1667
- @auto_index = object.to_param
1668
- else
1669
- raise ArgumentError, "object[] naming but object param and @object var don't exist or don't respond to to_param: #{object.inspect}"
1670
- end
1671
- end
1672
-
1673
- @multipart = nil
1674
- @index = options[:index] || options[:child_index]
1675
- end
1676
-
1677
- (field_helpers - [:label, :check_box, :radio_button, :fields_for, :fields, :hidden_field, :file_field]).each do |selector|
1678
- class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
1679
- def #{selector}(method, options = {}) # def text_field(method, options = {})
1680
- @template.send( # @template.send(
1681
- #{selector.inspect}, # "text_field",
1682
- @object_name, # @object_name,
1683
- method, # method,
1684
- objectify_options(options)) # objectify_options(options))
1685
- end # end
1686
- RUBY_EVAL
1687
- end
1688
-
1689
- # Creates a scope around a specific model object like form_for, but
1690
- # doesn't create the form tags themselves. This makes fields_for suitable
1691
- # for specifying additional model objects in the same form.
1692
- #
1693
- # Although the usage and purpose of +fields_for+ is similar to +form_for+'s,
1694
- # its method signature is slightly different. Like +form_for+, it yields
1695
- # a FormBuilder object associated with a particular model object to a block,
1696
- # and within the block allows methods to be called on the builder to
1697
- # generate fields associated with the model object. Fields may reflect
1698
- # a model object in two ways - how they are named (hence how submitted
1699
- # values appear within the +params+ hash in the controller) and what
1700
- # default values are shown when the form the fields appear in is first
1701
- # displayed. In order for both of these features to be specified independently,
1702
- # both an object name (represented by either a symbol or string) and the
1703
- # object itself can be passed to the method separately -
1704
- #
1705
- # <%= form_for @person do |person_form| %>
1706
- # First name: <%= person_form.text_field :first_name %>
1707
- # Last name : <%= person_form.text_field :last_name %>
1708
- #
1709
- # <%= fields_for :permission, @person.permission do |permission_fields| %>
1710
- # Admin? : <%= permission_fields.check_box :admin %>
1711
- # <% end %>
1712
- #
1713
- # <%= person_form.submit %>
1714
- # <% end %>
1715
- #
1716
- # In this case, the checkbox field will be represented by an HTML +input+
1717
- # tag with the +name+ attribute <tt>permission[admin]</tt>, and the submitted
1718
- # value will appear in the controller as <tt>params[:permission][:admin]</tt>.
1719
- # If <tt>@person.permission</tt> is an existing record with an attribute
1720
- # +admin+, the initial state of the checkbox when first displayed will
1721
- # reflect the value of <tt>@person.permission.admin</tt>.
1722
- #
1723
- # Often this can be simplified by passing just the name of the model
1724
- # object to +fields_for+ -
1725
- #
1726
- # <%= fields_for :permission do |permission_fields| %>
1727
- # Admin?: <%= permission_fields.check_box :admin %>
1728
- # <% end %>
1729
- #
1730
- # ...in which case, if <tt>:permission</tt> also happens to be the name of an
1731
- # instance variable <tt>@permission</tt>, the initial state of the input
1732
- # field will reflect the value of that variable's attribute <tt>@permission.admin</tt>.
1733
- #
1734
- # Alternatively, you can pass just the model object itself (if the first
1735
- # argument isn't a string or symbol +fields_for+ will realize that the
1736
- # name has been omitted) -
1737
- #
1738
- # <%= fields_for @person.permission do |permission_fields| %>
1739
- # Admin?: <%= permission_fields.check_box :admin %>
1740
- # <% end %>
1741
- #
1742
- # and +fields_for+ will derive the required name of the field from the
1743
- # _class_ of the model object, e.g. if <tt>@person.permission</tt>, is
1744
- # of class +Permission+, the field will still be named <tt>permission[admin]</tt>.
1745
- #
1746
- # Note: This also works for the methods in FormOptionsHelper and
1747
- # DateHelper that are designed to work with an object as base, like
1748
- # FormOptionsHelper#collection_select and DateHelper#datetime_select.
1749
- #
1750
- # === Nested Attributes Examples
1751
- #
1752
- # When the object belonging to the current scope has a nested attribute
1753
- # writer for a certain attribute, fields_for will yield a new scope
1754
- # for that attribute. This allows you to create forms that set or change
1755
- # the attributes of a parent object and its associations in one go.
1756
- #
1757
- # Nested attribute writers are normal setter methods named after an
1758
- # association. The most common way of defining these writers is either
1759
- # with +accepts_nested_attributes_for+ in a model definition or by
1760
- # defining a method with the proper name. For example: the attribute
1761
- # writer for the association <tt>:address</tt> is called
1762
- # <tt>address_attributes=</tt>.
1763
- #
1764
- # Whether a one-to-one or one-to-many style form builder will be yielded
1765
- # depends on whether the normal reader method returns a _single_ object
1766
- # or an _array_ of objects.
1767
- #
1768
- # ==== One-to-one
1769
- #
1770
- # Consider a Person class which returns a _single_ Address from the
1771
- # <tt>address</tt> reader method and responds to the
1772
- # <tt>address_attributes=</tt> writer method:
1773
- #
1774
- # class Person
1775
- # def address
1776
- # @address
1777
- # end
1778
- #
1779
- # def address_attributes=(attributes)
1780
- # # Process the attributes hash
1781
- # end
1782
- # end
1783
- #
1784
- # This model can now be used with a nested fields_for, like so:
1785
- #
1786
- # <%= form_for @person do |person_form| %>
1787
- # ...
1788
- # <%= person_form.fields_for :address do |address_fields| %>
1789
- # Street : <%= address_fields.text_field :street %>
1790
- # Zip code: <%= address_fields.text_field :zip_code %>
1791
- # <% end %>
1792
- # ...
1793
- # <% end %>
1794
- #
1795
- # When address is already an association on a Person you can use
1796
- # +accepts_nested_attributes_for+ to define the writer method for you:
1797
- #
1798
- # class Person < ActiveRecord::Base
1799
- # has_one :address
1800
- # accepts_nested_attributes_for :address
1801
- # end
1802
- #
1803
- # If you want to destroy the associated model through the form, you have
1804
- # to enable it first using the <tt>:allow_destroy</tt> option for
1805
- # +accepts_nested_attributes_for+:
1806
- #
1807
- # class Person < ActiveRecord::Base
1808
- # has_one :address
1809
- # accepts_nested_attributes_for :address, allow_destroy: true
1810
- # end
1811
- #
1812
- # Now, when you use a form element with the <tt>_destroy</tt> parameter,
1813
- # with a value that evaluates to +true+, you will destroy the associated
1814
- # model (eg. 1, '1', true, or 'true'):
1815
- #
1816
- # <%= form_for @person do |person_form| %>
1817
- # ...
1818
- # <%= person_form.fields_for :address do |address_fields| %>
1819
- # ...
1820
- # Delete: <%= address_fields.check_box :_destroy %>
1821
- # <% end %>
1822
- # ...
1823
- # <% end %>
1824
- #
1825
- # ==== One-to-many
1826
- #
1827
- # Consider a Person class which returns an _array_ of Project instances
1828
- # from the <tt>projects</tt> reader method and responds to the
1829
- # <tt>projects_attributes=</tt> writer method:
1830
- #
1831
- # class Person
1832
- # def projects
1833
- # [@project1, @project2]
1834
- # end
1835
- #
1836
- # def projects_attributes=(attributes)
1837
- # # Process the attributes hash
1838
- # end
1839
- # end
1840
- #
1841
- # Note that the <tt>projects_attributes=</tt> writer method is in fact
1842
- # required for fields_for to correctly identify <tt>:projects</tt> as a
1843
- # collection, and the correct indices to be set in the form markup.
1844
- #
1845
- # When projects is already an association on Person you can use
1846
- # +accepts_nested_attributes_for+ to define the writer method for you:
1847
- #
1848
- # class Person < ActiveRecord::Base
1849
- # has_many :projects
1850
- # accepts_nested_attributes_for :projects
1851
- # end
1852
- #
1853
- # This model can now be used with a nested fields_for. The block given to
1854
- # the nested fields_for call will be repeated for each instance in the
1855
- # collection:
1856
- #
1857
- # <%= form_for @person do |person_form| %>
1858
- # ...
1859
- # <%= person_form.fields_for :projects do |project_fields| %>
1860
- # <% if project_fields.object.active? %>
1861
- # Name: <%= project_fields.text_field :name %>
1862
- # <% end %>
1863
- # <% end %>
1864
- # ...
1865
- # <% end %>
1866
- #
1867
- # It's also possible to specify the instance to be used:
1868
- #
1869
- # <%= form_for @person do |person_form| %>
1870
- # ...
1871
- # <% @person.projects.each do |project| %>
1872
- # <% if project.active? %>
1873
- # <%= person_form.fields_for :projects, project do |project_fields| %>
1874
- # Name: <%= project_fields.text_field :name %>
1875
- # <% end %>
1876
- # <% end %>
1877
- # <% end %>
1878
- # ...
1879
- # <% end %>
1880
- #
1881
- # Or a collection to be used:
1882
- #
1883
- # <%= form_for @person do |person_form| %>
1884
- # ...
1885
- # <%= person_form.fields_for :projects, @active_projects do |project_fields| %>
1886
- # Name: <%= project_fields.text_field :name %>
1887
- # <% end %>
1888
- # ...
1889
- # <% end %>
1890
- #
1891
- # If you want to destroy any of the associated models through the
1892
- # form, you have to enable it first using the <tt>:allow_destroy</tt>
1893
- # option for +accepts_nested_attributes_for+:
1894
- #
1895
- # class Person < ActiveRecord::Base
1896
- # has_many :projects
1897
- # accepts_nested_attributes_for :projects, allow_destroy: true
1898
- # end
1899
- #
1900
- # This will allow you to specify which models to destroy in the
1901
- # attributes hash by adding a form element for the <tt>_destroy</tt>
1902
- # parameter with a value that evaluates to +true+
1903
- # (eg. 1, '1', true, or 'true'):
1904
- #
1905
- # <%= form_for @person do |person_form| %>
1906
- # ...
1907
- # <%= person_form.fields_for :projects do |project_fields| %>
1908
- # Delete: <%= project_fields.check_box :_destroy %>
1909
- # <% end %>
1910
- # ...
1911
- # <% end %>
1912
- #
1913
- # When a collection is used you might want to know the index of each
1914
- # object into the array. For this purpose, the <tt>index</tt> method
1915
- # is available in the FormBuilder object.
1916
- #
1917
- # <%= form_for @person do |person_form| %>
1918
- # ...
1919
- # <%= person_form.fields_for :projects do |project_fields| %>
1920
- # Project #<%= project_fields.index %>
1921
- # ...
1922
- # <% end %>
1923
- # ...
1924
- # <% end %>
1925
- #
1926
- # Note that fields_for will automatically generate a hidden field
1927
- # to store the ID of the record. There are circumstances where this
1928
- # hidden field is not needed and you can pass <tt>include_id: false</tt>
1929
- # to prevent fields_for from rendering it automatically.
1930
- def fields_for(record_name, record_object = nil, fields_options = {}, &block)
1931
- fields_options, record_object = record_object, nil if record_object.is_a?(Hash) && record_object.extractable_options?
1932
- fields_options[:builder] ||= options[:builder]
1933
- fields_options[:namespace] = options[:namespace]
1934
- fields_options[:parent_builder] = self
1935
-
1936
- case record_name
1937
- when String, Symbol
1938
- if nested_attributes_association?(record_name)
1939
- return fields_for_with_nested_attributes(record_name, record_object, fields_options, block)
1940
- end
1941
- else
1942
- record_object = record_name.is_a?(Array) ? record_name.last : record_name
1943
- record_name = model_name_from_record_or_class(record_object).param_key
1944
- end
1945
-
1946
- object_name = @object_name
1947
- index = if options.has_key?(:index)
1948
- options[:index]
1949
- elsif defined?(@auto_index)
1950
- object_name = object_name.to_s.sub(/\[\]$/, "")
1951
- @auto_index
1952
- end
1953
-
1954
- record_name = if index
1955
- "#{object_name}[#{index}][#{record_name}]"
1956
- elsif record_name.to_s.end_with?("[]")
1957
- record_name = record_name.to_s.sub(/(.*)\[\]$/, "[\\1][#{record_object.id}]")
1958
- "#{object_name}#{record_name}"
1959
- else
1960
- "#{object_name}[#{record_name}]"
1961
- end
1962
- fields_options[:child_index] = index
1963
-
1964
- @template.fields_for(record_name, record_object, fields_options, &block)
1965
- end
1966
-
1967
- # See the docs for the <tt>ActionView::FormHelper.fields</tt> helper method.
1968
- def fields(scope = nil, model: nil, **options, &block)
1969
- options[:allow_method_names_outside_object] = true
1970
- options[:skip_default_ids] = !FormHelper.form_with_generates_ids
1971
-
1972
- convert_to_legacy_options(options)
1973
-
1974
- fields_for(scope || model, model, **options, &block)
1975
- end
1976
-
1977
- # Returns a label tag tailored for labelling an input field for a specified attribute (identified by +method+) on an object
1978
- # assigned to the template (identified by +object+). The text of label will default to the attribute name unless a translation
1979
- # is found in the current I18n locale (through helpers.label.<modelname>.<attribute>) or you specify it explicitly.
1980
- # Additional options on the label tag can be passed as a hash with +options+. These options will be tagged
1981
- # onto the HTML as an HTML element attribute as in the example shown, except for the <tt>:value</tt> option, which is designed to
1982
- # target labels for radio_button tags (where the value is used in the ID of the input tag).
1983
- #
1984
- # ==== Examples
1985
- # label(:title)
1986
- # # => <label for="post_title">Title</label>
1987
- #
1988
- # You can localize your labels based on model and attribute names.
1989
- # For example you can define the following in your locale (e.g. en.yml)
1990
- #
1991
- # helpers:
1992
- # label:
1993
- # post:
1994
- # body: "Write your entire text here"
1995
- #
1996
- # Which then will result in
1997
- #
1998
- # label(:body)
1999
- # # => <label for="post_body">Write your entire text here</label>
2000
- #
2001
- # Localization can also be based purely on the translation of the attribute-name
2002
- # (if you are using ActiveRecord):
2003
- #
2004
- # activerecord:
2005
- # attributes:
2006
- # post:
2007
- # cost: "Total cost"
2008
- #
2009
- # label(:cost)
2010
- # # => <label for="post_cost">Total cost</label>
2011
- #
2012
- # label(:title, "A short title")
2013
- # # => <label for="post_title">A short title</label>
2014
- #
2015
- # label(:title, "A short title", class: "title_label")
2016
- # # => <label for="post_title" class="title_label">A short title</label>
2017
- #
2018
- # label(:privacy, "Public Post", value: "public")
2019
- # # => <label for="post_privacy_public">Public Post</label>
2020
- #
2021
- # label(:terms) do
2022
- # raw('Accept <a href="/terms">Terms</a>.')
2023
- # end
2024
- # # => <label for="post_terms">Accept <a href="/terms">Terms</a>.</label>
2025
- def label(method, text = nil, options = {}, &block)
2026
- @template.label(@object_name, method, text, objectify_options(options), &block)
2027
- end
2028
-
2029
- # Returns a checkbox tag tailored for accessing a specified attribute (identified by +method+) on an object
2030
- # assigned to the template (identified by +object+). This object must be an instance object (@object) and not a local object.
2031
- # It's intended that +method+ returns an integer and if that integer is above zero, then the checkbox is checked.
2032
- # Additional options on the input tag can be passed as a hash with +options+. The +checked_value+ defaults to 1
2033
- # while the default +unchecked_value+ is set to 0 which is convenient for boolean values.
2034
- #
2035
- # ==== Gotcha
2036
- #
2037
- # The HTML specification says unchecked check boxes are not successful, and
2038
- # thus web browsers do not send them. Unfortunately this introduces a gotcha:
2039
- # if an +Invoice+ model has a +paid+ flag, and in the form that edits a paid
2040
- # invoice the user unchecks its check box, no +paid+ parameter is sent. So,
2041
- # any mass-assignment idiom like
2042
- #
2043
- # @invoice.update(params[:invoice])
2044
- #
2045
- # wouldn't update the flag.
2046
- #
2047
- # To prevent this the helper generates an auxiliary hidden field before
2048
- # the very check box. The hidden field has the same name and its
2049
- # attributes mimic an unchecked check box.
2050
- #
2051
- # This way, the client either sends only the hidden field (representing
2052
- # the check box is unchecked), or both fields. Since the HTML specification
2053
- # says key/value pairs have to be sent in the same order they appear in the
2054
- # form, and parameters extraction gets the last occurrence of any repeated
2055
- # key in the query string, that works for ordinary forms.
2056
- #
2057
- # Unfortunately that workaround does not work when the check box goes
2058
- # within an array-like parameter, as in
2059
- #
2060
- # <%= fields_for "project[invoice_attributes][]", invoice, index: nil do |form| %>
2061
- # <%= form.check_box :paid %>
2062
- # ...
2063
- # <% end %>
2064
- #
2065
- # because parameter name repetition is precisely what Rails seeks to distinguish
2066
- # the elements of the array. For each item with a checked check box you
2067
- # get an extra ghost item with only that attribute, assigned to "0".
2068
- #
2069
- # In that case it is preferable to either use +check_box_tag+ or to use
2070
- # hashes instead of arrays.
2071
- #
2072
- # # Let's say that @post.validated? is 1:
2073
- # check_box("validated")
2074
- # # => <input name="post[validated]" type="hidden" value="0" />
2075
- # # <input checked="checked" type="checkbox" id="post_validated" name="post[validated]" value="1" />
2076
- #
2077
- # # Let's say that @puppy.gooddog is "no":
2078
- # check_box("gooddog", {}, "yes", "no")
2079
- # # => <input name="puppy[gooddog]" type="hidden" value="no" />
2080
- # # <input type="checkbox" id="puppy_gooddog" name="puppy[gooddog]" value="yes" />
2081
- #
2082
- # # Let's say that @eula.accepted is "no":
2083
- # check_box("accepted", { class: 'eula_check' }, "yes", "no")
2084
- # # => <input name="eula[accepted]" type="hidden" value="no" />
2085
- # # <input type="checkbox" class="eula_check" id="eula_accepted" name="eula[accepted]" value="yes" />
2086
- def check_box(method, options = {}, checked_value = "1", unchecked_value = "0")
2087
- @template.check_box(@object_name, method, objectify_options(options), checked_value, unchecked_value)
2088
- end
2089
-
2090
- # Returns a radio button tag for accessing a specified attribute (identified by +method+) on an object
2091
- # assigned to the template (identified by +object+). If the current value of +method+ is +tag_value+ the
2092
- # radio button will be checked.
2093
- #
2094
- # To force the radio button to be checked pass <tt>checked: true</tt> in the
2095
- # +options+ hash. You may pass HTML options there as well.
2096
- #
2097
- # # Let's say that @post.category returns "rails":
2098
- # radio_button("category", "rails")
2099
- # radio_button("category", "java")
2100
- # # => <input type="radio" id="post_category_rails" name="post[category]" value="rails" checked="checked" />
2101
- # # <input type="radio" id="post_category_java" name="post[category]" value="java" />
2102
- #
2103
- # # Let's say that @user.receive_newsletter returns "no":
2104
- # radio_button("receive_newsletter", "yes")
2105
- # radio_button("receive_newsletter", "no")
2106
- # # => <input type="radio" id="user_receive_newsletter_yes" name="user[receive_newsletter]" value="yes" />
2107
- # # <input type="radio" id="user_receive_newsletter_no" name="user[receive_newsletter]" value="no" checked="checked" />
2108
- def radio_button(method, tag_value, options = {})
2109
- @template.radio_button(@object_name, method, tag_value, objectify_options(options))
2110
- end
2111
-
2112
- # Returns a hidden input tag tailored for accessing a specified attribute (identified by +method+) on an object
2113
- # assigned to the template (identified by +object+). Additional options on the input tag can be passed as a
2114
- # hash with +options+. These options will be tagged onto the HTML as an HTML element attribute as in the example
2115
- # shown.
2116
- #
2117
- # ==== Examples
2118
- # # Let's say that @signup.pass_confirm returns true:
2119
- # hidden_field(:pass_confirm)
2120
- # # => <input type="hidden" id="signup_pass_confirm" name="signup[pass_confirm]" value="true" />
2121
- #
2122
- # # Let's say that @post.tag_list returns "blog, ruby":
2123
- # hidden_field(:tag_list)
2124
- # # => <input type="hidden" id="post_tag_list" name="post[tag_list]" value="blog, ruby" />
2125
- #
2126
- # # Let's say that @user.token returns "abcde":
2127
- # hidden_field(:token)
2128
- # # => <input type="hidden" id="user_token" name="user[token]" value="abcde" />
2129
- #
2130
- def hidden_field(method, options = {})
2131
- @emitted_hidden_id = true if method == :id
2132
- @template.hidden_field(@object_name, method, objectify_options(options))
2133
- end
2134
-
2135
- # Returns a file upload input tag tailored for accessing a specified attribute (identified by +method+) on an object
2136
- # assigned to the template (identified by +object+). Additional options on the input tag can be passed as a
2137
- # hash with +options+. These options will be tagged onto the HTML as an HTML element attribute as in the example
2138
- # shown.
2139
- #
2140
- # Using this method inside a +form_for+ block will set the enclosing form's encoding to <tt>multipart/form-data</tt>.
2141
- #
2142
- # ==== Options
2143
- # * Creates standard HTML attributes for the tag.
2144
- # * <tt>:disabled</tt> - If set to true, the user will not be able to use this input.
2145
- # * <tt>:multiple</tt> - If set to true, *in most updated browsers* the user will be allowed to select multiple files.
2146
- # * <tt>:accept</tt> - If set to one or multiple mime-types, the user will be suggested a filter when choosing a file. You still need to set up model validations.
2147
- #
2148
- # ==== Examples
2149
- # # Let's say that @user has avatar:
2150
- # file_field(:avatar)
2151
- # # => <input type="file" id="user_avatar" name="user[avatar]" />
2152
- #
2153
- # # Let's say that @post has image:
2154
- # file_field(:image, :multiple => true)
2155
- # # => <input type="file" id="post_image" name="post[image][]" multiple="multiple" />
2156
- #
2157
- # # Let's say that @post has attached:
2158
- # file_field(:attached, accept: 'text/html')
2159
- # # => <input accept="text/html" type="file" id="post_attached" name="post[attached]" />
2160
- #
2161
- # # Let's say that @post has image:
2162
- # file_field(:image, accept: 'image/png,image/gif,image/jpeg')
2163
- # # => <input type="file" id="post_image" name="post[image]" accept="image/png,image/gif,image/jpeg" />
2164
- #
2165
- # # Let's say that @attachment has file:
2166
- # file_field(:file, class: 'file_input')
2167
- # # => <input type="file" id="attachment_file" name="attachment[file]" class="file_input" />
2168
- def file_field(method, options = {})
2169
- self.multipart = true
2170
- @template.file_field(@object_name, method, objectify_options(options))
2171
- end
2172
-
2173
- # Add the submit button for the given form. When no value is given, it checks
2174
- # if the object is a new resource or not to create the proper label:
2175
- #
2176
- # <%= form_for @post do |f| %>
2177
- # <%= f.submit %>
2178
- # <% end %>
2179
- #
2180
- # In the example above, if <tt>@post</tt> is a new record, it will use "Create Post" as
2181
- # submit button label; otherwise, it uses "Update Post".
2182
- #
2183
- # Those labels can be customized using I18n under the +helpers.submit+ key and using
2184
- # <tt>%{model}</tt> for translation interpolation:
2185
- #
2186
- # en:
2187
- # helpers:
2188
- # submit:
2189
- # create: "Create a %{model}"
2190
- # update: "Confirm changes to %{model}"
2191
- #
2192
- # It also searches for a key specific to the given object:
2193
- #
2194
- # en:
2195
- # helpers:
2196
- # submit:
2197
- # post:
2198
- # create: "Add %{model}"
2199
- #
2200
- def submit(value = nil, options = {})
2201
- value, options = nil, value if value.is_a?(Hash)
2202
- value ||= submit_default_value
2203
- @template.submit_tag(value, options)
2204
- end
2205
-
2206
- # Add the submit button for the given form. When no value is given, it checks
2207
- # if the object is a new resource or not to create the proper label:
2208
- #
2209
- # <%= form_for @post do |f| %>
2210
- # <%= f.button %>
2211
- # <% end %>
2212
- #
2213
- # In the example above, if <tt>@post</tt> is a new record, it will use "Create Post" as
2214
- # button label; otherwise, it uses "Update Post".
2215
- #
2216
- # Those labels can be customized using I18n under the +helpers.submit+ key
2217
- # (the same as submit helper) and using <tt>%{model}</tt> for translation interpolation:
2218
- #
2219
- # en:
2220
- # helpers:
2221
- # submit:
2222
- # create: "Create a %{model}"
2223
- # update: "Confirm changes to %{model}"
2224
- #
2225
- # It also searches for a key specific to the given object:
2226
- #
2227
- # en:
2228
- # helpers:
2229
- # submit:
2230
- # post:
2231
- # create: "Add %{model}"
2232
- #
2233
- # ==== Examples
2234
- # button("Create post")
2235
- # # => <button name='button' type='submit'>Create post</button>
2236
- #
2237
- # button do
2238
- # content_tag(:strong, 'Ask me!')
2239
- # end
2240
- # # => <button name='button' type='submit'>
2241
- # # <strong>Ask me!</strong>
2242
- # # </button>
2243
- #
2244
- def button(value = nil, options = {}, &block)
2245
- value, options = nil, value if value.is_a?(Hash)
2246
- value ||= submit_default_value
2247
- @template.button_tag(value, options, &block)
2248
- end
2249
-
2250
- def emitted_hidden_id?
2251
- @emitted_hidden_id ||= nil
2252
- end
2253
-
2254
- private
2255
- def objectify_options(options)
2256
- @default_options.merge(options.merge(object: @object))
2257
- end
2258
-
2259
- def submit_default_value
2260
- object = convert_to_model(@object)
2261
- key = object ? (object.persisted? ? :update : :create) : :submit
2262
-
2263
- model = if object.respond_to?(:model_name)
2264
- object.model_name.human
2265
- else
2266
- @object_name.to_s.humanize
2267
- end
2268
-
2269
- defaults = []
2270
- defaults << :"helpers.submit.#{object_name}.#{key}"
2271
- defaults << :"helpers.submit.#{key}"
2272
- defaults << "#{key.to_s.humanize} #{model}"
2273
-
2274
- I18n.t(defaults.shift, model: model, default: defaults)
2275
- end
2276
-
2277
- def nested_attributes_association?(association_name)
2278
- @object.respond_to?("#{association_name}_attributes=")
2279
- end
2280
-
2281
- def fields_for_with_nested_attributes(association_name, association, options, block)
2282
- name = "#{object_name}[#{association_name}_attributes]"
2283
- association = convert_to_model(association)
2284
-
2285
- if association.respond_to?(:persisted?)
2286
- association = [association] if @object.send(association_name).respond_to?(:to_ary)
2287
- elsif !association.respond_to?(:to_ary)
2288
- association = @object.send(association_name)
2289
- end
2290
-
2291
- if association.respond_to?(:to_ary)
2292
- explicit_child_index = options[:child_index]
2293
- output = ActiveSupport::SafeBuffer.new
2294
- association.each do |child|
2295
- if explicit_child_index
2296
- options[:child_index] = explicit_child_index.call if explicit_child_index.respond_to?(:call)
2297
- else
2298
- options[:child_index] = nested_child_index(name)
2299
- end
2300
- output << fields_for_nested_model("#{name}[#{options[:child_index]}]", child, options, block)
2301
- end
2302
- output
2303
- elsif association
2304
- fields_for_nested_model(name, association, options, block)
2305
- end
2306
- end
2307
-
2308
- def fields_for_nested_model(name, object, fields_options, block)
2309
- object = convert_to_model(object)
2310
- emit_hidden_id = object.persisted? && fields_options.fetch(:include_id) {
2311
- options.fetch(:include_id, true)
2312
- }
2313
-
2314
- @template.fields_for(name, object, fields_options) do |f|
2315
- output = @template.capture(f, &block)
2316
- output.concat f.hidden_field(:id) if output && emit_hidden_id && !f.emitted_hidden_id?
2317
- output
2318
- end
2319
- end
2320
-
2321
- def nested_child_index(name)
2322
- @nested_child_index[name] ||= -1
2323
- @nested_child_index[name] += 1
2324
- end
2325
-
2326
- def convert_to_legacy_options(options)
2327
- if options.key?(:skip_id)
2328
- options[:include_id] = !options.delete(:skip_id)
2329
- end
2330
- end
2331
- end
2332
- end
2333
-
2334
- ActiveSupport.on_load(:action_view) do
2335
- cattr_accessor :default_form_builder, instance_writer: false, instance_reader: false, default: ::ActionView::Helpers::FormBuilder
2336
- end
2337
- end