ext_form 0.1.4

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 (333) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +31 -0
  4. data/app/assets/javascripts/ext_form/application.js +78 -0
  5. data/app/assets/javascripts/typeahead.js +1159 -0
  6. data/app/assets/stylesheets/ext_form/application.scss +15 -0
  7. data/app/assets/stylesheets/ext_form/application_bootstrap.css.scss +197 -0
  8. data/app/assets/stylesheets/ext_form/base.css.scss +32 -0
  9. data/config/routes.rb +2 -0
  10. data/lib/ext_form/builders/form_builder_base.rb +224 -0
  11. data/lib/ext_form/builders.rb +10 -0
  12. data/lib/ext_form/components/input_addons.rb +34 -0
  13. data/lib/ext_form/components.rb +7 -0
  14. data/lib/ext_form/engine.rb +14 -0
  15. data/lib/ext_form/helpers/form_helper.rb +222 -0
  16. data/lib/ext_form/helpers/form_tag_helper.rb +60 -0
  17. data/lib/ext_form/helpers/tags/auto_complete.rb +25 -0
  18. data/lib/ext_form/helpers/tags/collection_select.rb +19 -0
  19. data/lib/ext_form/helpers/tags/dt_picker.rb +27 -0
  20. data/lib/ext_form/helpers/tags/grouped_collection_select.rb +19 -0
  21. data/lib/ext_form/helpers/tags.rb +12 -0
  22. data/lib/ext_form/inputs/auto_complete.rb +11 -0
  23. data/lib/ext_form/inputs/base_mixin.rb +11 -0
  24. data/lib/ext_form/inputs/bootstrap_inputs_mixin.rb +13 -0
  25. data/lib/ext_form/inputs/collection_select.rb +15 -0
  26. data/lib/ext_form/inputs/dt_picker.rb +20 -0
  27. data/lib/ext_form/inputs/grouped_collection_select.rb +13 -0
  28. data/lib/ext_form/inputs.rb +15 -0
  29. data/lib/ext_form/layouts/base_layout.rb +82 -0
  30. data/lib/ext_form/layouts/bootstrap_layout.rb +23 -0
  31. data/lib/ext_form/layouts/default_layout.rb +29 -0
  32. data/lib/ext_form/layouts.rb +11 -0
  33. data/lib/ext_form/version.rb +3 -0
  34. data/lib/ext_form/wrappers/many_mixin.rb +18 -0
  35. data/lib/ext_form/wrappers/mixin.rb +49 -0
  36. data/lib/ext_form/wrappers/single_mixin.rb +18 -0
  37. data/lib/ext_form/wrappers.rb +11 -0
  38. data/lib/ext_form.rb +52 -0
  39. data/lib/generators/ext_form/USAGE +3 -0
  40. data/lib/generators/ext_form/install_generator.rb +113 -0
  41. data/lib/generators/ext_form/templates/README +15 -0
  42. data/lib/generators/ext_form/templates/_form.html.erb +12 -0
  43. data/lib/generators/ext_form/templates/_form.html.haml +12 -0
  44. data/lib/generators/ext_form/templates/_form.html.slim +12 -0
  45. data/lib/generators/ext_form/templates/config/initializers/z_ext_form.rb +70 -0
  46. data/lib/generators/ext_form/templates/config/initializers/z_ext_form_bootstrap.rb +59 -0
  47. data/lib/generators/ext_form/templates/config/locales/ext_form.en.yml +2 -0
  48. data/lib/tasks/ext_form_tasks.rake +4 -0
  49. data/spec/builders/ext_form_builder_bs_spec.rb +78 -0
  50. data/spec/builders/ext_form_builder_spec.rb +100 -0
  51. data/spec/dummy/README.rdoc +28 -0
  52. data/spec/dummy/Rakefile +6 -0
  53. data/spec/dummy/app/assets/javascripts/application.js +27 -0
  54. data/spec/dummy/app/assets/javascripts/order_headers.js +2 -0
  55. data/spec/dummy/app/assets/javascripts/order_lines.js +2 -0
  56. data/spec/dummy/app/assets/javascripts/shipments.js +2 -0
  57. data/spec/dummy/app/assets/stylesheets/application.css.scss +17 -0
  58. data/spec/dummy/app/assets/stylesheets/order_headers.css +4 -0
  59. data/spec/dummy/app/assets/stylesheets/order_lines.css +4 -0
  60. data/spec/dummy/app/assets/stylesheets/scaffold.css +56 -0
  61. data/spec/dummy/app/assets/stylesheets/shipments.css +4 -0
  62. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  63. data/spec/dummy/app/controllers/order_headers_controller.rb +62 -0
  64. data/spec/dummy/app/controllers/order_lines_controller.rb +58 -0
  65. data/spec/dummy/app/controllers/shipments_controller.rb +58 -0
  66. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  67. data/spec/dummy/app/helpers/order_headers_helper.rb +2 -0
  68. data/spec/dummy/app/helpers/order_lines_helper.rb +2 -0
  69. data/spec/dummy/app/helpers/shipments_helper.rb +2 -0
  70. data/spec/dummy/app/models/order_header.rb +9 -0
  71. data/spec/dummy/app/models/order_line.rb +6 -0
  72. data/spec/dummy/app/models/order_type.rb +2 -0
  73. data/spec/dummy/app/models/shipment.rb +3 -0
  74. data/spec/dummy/app/views/layouts/application.html.erb +17 -0
  75. data/spec/dummy/app/views/order_headers/_form.html.erb +53 -0
  76. data/spec/dummy/app/views/order_headers/edit.html.erb +3 -0
  77. data/spec/dummy/app/views/order_headers/index.html.erb +29 -0
  78. data/spec/dummy/app/views/order_headers/new.html.erb +5 -0
  79. data/spec/dummy/app/views/order_headers/show.html.erb +14 -0
  80. data/spec/dummy/app/views/order_lines/_form.html.erb +33 -0
  81. data/spec/dummy/app/views/order_lines/edit.html.erb +6 -0
  82. data/spec/dummy/app/views/order_lines/index.html.erb +33 -0
  83. data/spec/dummy/app/views/order_lines/new.html.erb +5 -0
  84. data/spec/dummy/app/views/order_lines/show.html.erb +24 -0
  85. data/spec/dummy/app/views/shipments/_form.html.erb +37 -0
  86. data/spec/dummy/app/views/shipments/edit.html.erb +6 -0
  87. data/spec/dummy/app/views/shipments/index.html.erb +35 -0
  88. data/spec/dummy/app/views/shipments/new.html.erb +5 -0
  89. data/spec/dummy/app/views/shipments/show.html.erb +29 -0
  90. data/spec/dummy/bin/bundle +3 -0
  91. data/spec/dummy/bin/rails +4 -0
  92. data/spec/dummy/bin/rake +4 -0
  93. data/spec/dummy/config/application.rb +28 -0
  94. data/spec/dummy/config/boot.rb +5 -0
  95. data/spec/dummy/config/database.yml +25 -0
  96. data/spec/dummy/config/environment.rb +5 -0
  97. data/spec/dummy/config/environments/development.rb +29 -0
  98. data/spec/dummy/config/environments/production.rb +80 -0
  99. data/spec/dummy/config/environments/test.rb +36 -0
  100. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  101. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  102. data/spec/dummy/config/initializers/inflections.rb +16 -0
  103. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  104. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  105. data/spec/dummy/config/initializers/session_store.rb +3 -0
  106. data/spec/dummy/config/initializers/simple_form.rb +145 -0
  107. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  108. data/spec/dummy/config/initializers/z_ext_form.rb +70 -0
  109. data/spec/dummy/config/initializers/z_ext_form_bootstrap.rb +59 -0
  110. data/spec/dummy/config/locales/en.yml +23 -0
  111. data/spec/dummy/config/locales/ext_form.en.yml +26 -0
  112. data/spec/dummy/config/locales/simple_form.en.yml +26 -0
  113. data/spec/dummy/config/routes.rb +10 -0
  114. data/spec/dummy/config.ru +4 -0
  115. data/spec/dummy/db/development.sqlite3 +0 -0
  116. data/spec/dummy/db/migrate/20130822091938_create_order_headers.rb +10 -0
  117. data/spec/dummy/db/migrate/20130822092035_create_order_lines.rb +12 -0
  118. data/spec/dummy/db/migrate/20130822092136_create_shipments.rb +13 -0
  119. data/spec/dummy/db/migrate/20130913025429_add_order_date_to_order_headers.rb +5 -0
  120. data/spec/dummy/db/migrate/20130913082503_add_bill_to_customer_to_order_headers.rb +7 -0
  121. data/spec/dummy/db/migrate/20130914101200_create_order_types.rb +9 -0
  122. data/spec/dummy/db/migrate/20130914101232_add_order_type_id_to_order_headers.rb +5 -0
  123. data/spec/dummy/db/schema.rb +64 -0
  124. data/spec/dummy/db/seeds.rb +3 -0
  125. data/spec/dummy/db/test.sqlite3 +0 -0
  126. data/spec/dummy/lib/templates/erb/scaffold/_form.html.erb +12 -0
  127. data/spec/dummy/lib/templates/slim/scaffold/_form.html.slim +12 -0
  128. data/spec/dummy/log/development.log +30851 -0
  129. data/spec/dummy/log/test.log +8888 -0
  130. data/spec/dummy/public/404.html +58 -0
  131. data/spec/dummy/public/422.html +58 -0
  132. data/spec/dummy/public/500.html +57 -0
  133. data/spec/dummy/public/favicon.ico +0 -0
  134. data/spec/dummy/public/javascripts/nested_form.js +120 -0
  135. data/spec/dummy/spec/factories/order_types.rb +7 -0
  136. data/spec/dummy/tmp/cache/assets/development/sass/0be6a8d566db001f251fcb3d330b625bdcde50b0/select2.css.scssc +0 -0
  137. data/spec/dummy/tmp/cache/assets/development/sass/0f754ef2ba2bade74c446fd0dc8d2c538b2ee4ba/bootstrap-datetimepicker.cssc +0 -0
  138. data/spec/dummy/tmp/cache/assets/development/sass/43e39f3776203b555edf4427cbeca13a3e80bf4e/application.scssc +0 -0
  139. data/spec/dummy/tmp/cache/assets/development/sass/43e39f3776203b555edf4427cbeca13a3e80bf4e/application_bootstrap.css.scssc +0 -0
  140. data/spec/dummy/tmp/cache/assets/development/sass/43e39f3776203b555edf4427cbeca13a3e80bf4e/base.css.scssc +0 -0
  141. data/spec/dummy/tmp/cache/assets/development/sass/95877ca3fb97306427e6a8c3200a77fa726c2979/bootstrap-responsive.scssc +0 -0
  142. data/spec/dummy/tmp/cache/assets/development/sass/95877ca3fb97306427e6a8c3200a77fa726c2979/bootstrap.scssc +0 -0
  143. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_accordion.scssc +0 -0
  144. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_alerts.scssc +0 -0
  145. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_breadcrumbs.scssc +0 -0
  146. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_button-groups.scssc +0 -0
  147. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_buttons.scssc +0 -0
  148. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_carousel.scssc +0 -0
  149. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_close.scssc +0 -0
  150. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_code.scssc +0 -0
  151. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_component-animations.scssc +0 -0
  152. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_dropdowns.scssc +0 -0
  153. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_forms.scssc +0 -0
  154. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_grid.scssc +0 -0
  155. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_hero-unit.scssc +0 -0
  156. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_labels-badges.scssc +0 -0
  157. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_layouts.scssc +0 -0
  158. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_media.scssc +0 -0
  159. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_mixins.scssc +0 -0
  160. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_modals.scssc +0 -0
  161. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_navbar.scssc +0 -0
  162. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_navs.scssc +0 -0
  163. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_pager.scssc +0 -0
  164. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_pagination.scssc +0 -0
  165. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_popovers.scssc +0 -0
  166. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_progress-bars.scssc +0 -0
  167. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_reset.scssc +0 -0
  168. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_responsive-1200px-min.scssc +0 -0
  169. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_responsive-767px-max.scssc +0 -0
  170. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_responsive-768px-979px.scssc +0 -0
  171. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_responsive-navbar.scssc +0 -0
  172. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_responsive-utilities.scssc +0 -0
  173. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_scaffolding.scssc +0 -0
  174. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_sprites.scssc +0 -0
  175. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_tables.scssc +0 -0
  176. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_thumbnails.scssc +0 -0
  177. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_tooltip.scssc +0 -0
  178. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_type.scssc +0 -0
  179. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_utilities.scssc +0 -0
  180. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_variables.scssc +0 -0
  181. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/_wells.scssc +0 -0
  182. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/bootstrap.scssc +0 -0
  183. data/spec/dummy/tmp/cache/assets/development/sass/c75ed21fe4fe5a931216dc17f876dea4e6c936a7/responsive.scssc +0 -0
  184. data/spec/dummy/tmp/cache/assets/development/sass/d8cdc3e1698ff449e2e9ab35ca24a00a8d724935/application.css.scssc +0 -0
  185. data/spec/dummy/tmp/cache/assets/development/sass/d8cdc3e1698ff449e2e9ab35ca24a00a8d724935/scaffolds.css.scssc +0 -0
  186. data/spec/dummy/tmp/cache/assets/development/sass/d8cdc3e1698ff449e2e9ab35ca24a00a8d724935/test_scaflds.css.scssc +0 -0
  187. data/spec/dummy/tmp/cache/assets/development/sprockets/00171108bd75279e653c1ffb5b4650b8 +0 -0
  188. data/spec/dummy/tmp/cache/assets/development/sprockets/05029f2e1c68338ac88af8005acab3ca +0 -0
  189. data/spec/dummy/tmp/cache/assets/development/sprockets/08318fdb5f5b783c22442a6aeb73730e +0 -0
  190. data/spec/dummy/tmp/cache/assets/development/sprockets/08f00d4a1bac197d382c2269a184f9e4 +0 -0
  191. data/spec/dummy/tmp/cache/assets/development/sprockets/0b6c06f6bcf535567c19f70f7aa5144d +0 -0
  192. data/spec/dummy/tmp/cache/assets/development/sprockets/0b9076b70e22dd7976e589018cdf65ca +0 -0
  193. data/spec/dummy/tmp/cache/assets/development/sprockets/0e8461b429e0249b8dc74d457fcc17d3 +0 -0
  194. data/spec/dummy/tmp/cache/assets/development/sprockets/0f074c0ea10680a3ba979bbd1d2ff756 +0 -0
  195. data/spec/dummy/tmp/cache/assets/development/sprockets/0f5877c1fb159c1a5f1602569a0cdde2 +0 -0
  196. data/spec/dummy/tmp/cache/assets/development/sprockets/0f8cf3c40768cf2ab52c613a7efc30cb +0 -0
  197. data/spec/dummy/tmp/cache/assets/development/sprockets/10fcfbe6ebae11a40c8eac41939a1b9a +0 -0
  198. data/spec/dummy/tmp/cache/assets/development/sprockets/126ebaa8ad57e48772c035caac2ed632 +0 -0
  199. data/spec/dummy/tmp/cache/assets/development/sprockets/13c6f1c4603d5736407a6b5f7889a056 +0 -0
  200. data/spec/dummy/tmp/cache/assets/development/sprockets/13f8355b45d7c46c05177fef3b7f6283 +0 -0
  201. data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  202. data/spec/dummy/tmp/cache/assets/development/sprockets/157d2eedb817dece09700185cd4101e3 +0 -0
  203. data/spec/dummy/tmp/cache/assets/development/sprockets/16039dc737e753516f4399dcd38d6de7 +0 -0
  204. data/spec/dummy/tmp/cache/assets/development/sprockets/19699f0bd9bbacb926aa665d057d7dcc +0 -0
  205. data/spec/dummy/tmp/cache/assets/development/sprockets/2013f24e3245656ca1e5890649a0b023 +0 -0
  206. data/spec/dummy/tmp/cache/assets/development/sprockets/26bd44751cc9640593dc583d6be8410d +0 -0
  207. data/spec/dummy/tmp/cache/assets/development/sprockets/272f5096d49f011351e9f4780c313741 +0 -0
  208. data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  209. data/spec/dummy/tmp/cache/assets/development/sprockets/32ef1c9e94a83350bad5e887c416c5b6 +0 -0
  210. data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  211. data/spec/dummy/tmp/cache/assets/development/sprockets/367865b241c60ef0e9a85c9f9910f7d4 +0 -0
  212. data/spec/dummy/tmp/cache/assets/development/sprockets/371bf96e99717688ed7313a0c53f4212 +0 -0
  213. data/spec/dummy/tmp/cache/assets/development/sprockets/37984c7de5e7d22002a378234035e51c +0 -0
  214. data/spec/dummy/tmp/cache/assets/development/sprockets/4201264f7710f91dc1c389a2497eda7d +0 -0
  215. data/spec/dummy/tmp/cache/assets/development/sprockets/4843087e4f4577291013564353d9be98 +0 -0
  216. data/spec/dummy/tmp/cache/assets/development/sprockets/490b125495df24b66caa52d70f8aa64d +0 -0
  217. data/spec/dummy/tmp/cache/assets/development/sprockets/4c9470e682578ab5fc183f98fae5f42d +0 -0
  218. data/spec/dummy/tmp/cache/assets/development/sprockets/4e81b6b6eb1e1462b1eea2caee6bfcc6 +0 -0
  219. data/spec/dummy/tmp/cache/assets/development/sprockets/510da110ae528e2d22533be39ff696c5 +0 -0
  220. data/spec/dummy/tmp/cache/assets/development/sprockets/518c73ecd762cbf6d85a3ae693e08d01 +0 -0
  221. data/spec/dummy/tmp/cache/assets/development/sprockets/56401bbafd08927b55572c8ef7e88883 +0 -0
  222. data/spec/dummy/tmp/cache/assets/development/sprockets/5865993e4fa54b7f6f0186ebaffff12b +0 -0
  223. data/spec/dummy/tmp/cache/assets/development/sprockets/59f25755df49e4db5915553e3d2ef412 +0 -0
  224. data/spec/dummy/tmp/cache/assets/development/sprockets/5a48dae6fe5b78da3082b1347022ee01 +0 -0
  225. data/spec/dummy/tmp/cache/assets/development/sprockets/5f62321f43b55988b6cb95367556d822 +0 -0
  226. data/spec/dummy/tmp/cache/assets/development/sprockets/61fab520b090f94084c9a7ffc402ad3c +0 -0
  227. data/spec/dummy/tmp/cache/assets/development/sprockets/653178c2e0c5d134069e58196f7bf28e +0 -0
  228. data/spec/dummy/tmp/cache/assets/development/sprockets/661c74f15a009d482fdad85f811e6f8e +0 -0
  229. data/spec/dummy/tmp/cache/assets/development/sprockets/6668d3ee30c1513097c95bcc0a27696a +0 -0
  230. data/spec/dummy/tmp/cache/assets/development/sprockets/690b40f9a765547b660ac81cbd5ed378 +0 -0
  231. data/spec/dummy/tmp/cache/assets/development/sprockets/6bdff36d9dbeb7ae3e6802b482a04668 +0 -0
  232. data/spec/dummy/tmp/cache/assets/development/sprockets/6eaa97256ef2d58208ab91c60707acdb +0 -0
  233. data/spec/dummy/tmp/cache/assets/development/sprockets/6fa120c855c745c904828746e82b2b07 +0 -0
  234. data/spec/dummy/tmp/cache/assets/development/sprockets/6fc757c2c8329244ca95d6909865bbc2 +0 -0
  235. data/spec/dummy/tmp/cache/assets/development/sprockets/715840f8887bc1e70ef3cc18b429cbc8 +0 -0
  236. data/spec/dummy/tmp/cache/assets/development/sprockets/754b02ea2ed1c85b7756de6452f4aeb7 +0 -0
  237. data/spec/dummy/tmp/cache/assets/development/sprockets/764fdaef2f219fafc8db0923a56c23a3 +0 -0
  238. data/spec/dummy/tmp/cache/assets/development/sprockets/78fdc1d9add39ed3fdcbf7cae3df4190 +0 -0
  239. data/spec/dummy/tmp/cache/assets/development/sprockets/7a7280187e89f6c4256217ea0fe1e787 +0 -0
  240. data/spec/dummy/tmp/cache/assets/development/sprockets/7b2d3e5e25b0901f78fbf8c9cb9570c4 +0 -0
  241. data/spec/dummy/tmp/cache/assets/development/sprockets/84eb79ed8e43cf9414e6ecfd38c5a19f +0 -0
  242. data/spec/dummy/tmp/cache/assets/development/sprockets/87172f2d7a412d1fe87d7775d589b883 +0 -0
  243. data/spec/dummy/tmp/cache/assets/development/sprockets/871fe15e38e1cf354ac33b4faf796fd3 +0 -0
  244. data/spec/dummy/tmp/cache/assets/development/sprockets/875849c72f053c7a7674e9fd72ee2cd4 +0 -0
  245. data/spec/dummy/tmp/cache/assets/development/sprockets/87a55c890eedab0cc5d1e3f2c2b2da4b +0 -0
  246. data/spec/dummy/tmp/cache/assets/development/sprockets/88741eb863751c5d5adb82282f6df5cd +0 -0
  247. data/spec/dummy/tmp/cache/assets/development/sprockets/8ab512c9b33ac90e699b73469d71f061 +0 -0
  248. data/spec/dummy/tmp/cache/assets/development/sprockets/8cc360b254f1bff91753f954e7591a9b +0 -0
  249. data/spec/dummy/tmp/cache/assets/development/sprockets/8ec990d84f5dedd35001397078415137 +0 -0
  250. data/spec/dummy/tmp/cache/assets/development/sprockets/9181401ef96921b28b49d4ec48261a4d +0 -0
  251. data/spec/dummy/tmp/cache/assets/development/sprockets/9409af55392b7f03edb441d5b53b931c +0 -0
  252. data/spec/dummy/tmp/cache/assets/development/sprockets/94e46c0e76c8f392586af76b0f6c6e93 +0 -0
  253. data/spec/dummy/tmp/cache/assets/development/sprockets/968566581a35be861fa4f8fed757dcae +0 -0
  254. data/spec/dummy/tmp/cache/assets/development/sprockets/96f8ac0ca90b5e46fb770d1695a77b2d +0 -0
  255. data/spec/dummy/tmp/cache/assets/development/sprockets/9b51a99e821d1802733dceac6764d18f +0 -0
  256. data/spec/dummy/tmp/cache/assets/development/sprockets/9d8681a4ce63f327a868f759096673e8 +0 -0
  257. data/spec/dummy/tmp/cache/assets/development/sprockets/a004f4ca229f6e9e761d2c86226e04f4 +0 -0
  258. data/spec/dummy/tmp/cache/assets/development/sprockets/a0a671e624f03533a82b1ec899bf3b21 +0 -0
  259. data/spec/dummy/tmp/cache/assets/development/sprockets/a0f669003bef02490064a16cfdb916fe +0 -0
  260. data/spec/dummy/tmp/cache/assets/development/sprockets/a411f643e05384fdb860f193e1dbe8f8 +0 -0
  261. data/spec/dummy/tmp/cache/assets/development/sprockets/a4abc5f3fc1bfe41be3470836766d110 +0 -0
  262. data/spec/dummy/tmp/cache/assets/development/sprockets/a82a869a86d5cbcbb101123eb6448f0c +0 -0
  263. data/spec/dummy/tmp/cache/assets/development/sprockets/a97cd428904e5968d05f7d3a5fd50f85 +0 -0
  264. data/spec/dummy/tmp/cache/assets/development/sprockets/aa87366fe7cd02f1be035665580cf066 +0 -0
  265. data/spec/dummy/tmp/cache/assets/development/sprockets/ada9a8c9882e963e6b98cdcaf20af34f +0 -0
  266. data/spec/dummy/tmp/cache/assets/development/sprockets/af326fcf9b4f69ff70d3610d0696b585 +0 -0
  267. data/spec/dummy/tmp/cache/assets/development/sprockets/af5ab48d2f371513fb609f8bdec3ac42 +0 -0
  268. data/spec/dummy/tmp/cache/assets/development/sprockets/b245fe00601bf4b4c2bd6ce9286a53dc +0 -0
  269. data/spec/dummy/tmp/cache/assets/development/sprockets/b51a3679ccee92d6e374deac3359cc69 +0 -0
  270. data/spec/dummy/tmp/cache/assets/development/sprockets/baed877d386dc374496dcd62af36bc5b +0 -0
  271. data/spec/dummy/tmp/cache/assets/development/sprockets/bc6f2f1da483ac27102f9412ee294dbf +0 -0
  272. data/spec/dummy/tmp/cache/assets/development/sprockets/bcca522c6302f184f12fe0e8a7d7e71a +0 -0
  273. data/spec/dummy/tmp/cache/assets/development/sprockets/bd3936370d0f952ada5774e2230046ed +0 -0
  274. data/spec/dummy/tmp/cache/assets/development/sprockets/c04a836e22ec09c7eae6eae9349efee3 +0 -0
  275. data/spec/dummy/tmp/cache/assets/development/sprockets/c13fc73ceafa45876a901b3e775b83ae +0 -0
  276. data/spec/dummy/tmp/cache/assets/development/sprockets/c2816385f6bc1d4ef24315437e9353d3 +0 -0
  277. data/spec/dummy/tmp/cache/assets/development/sprockets/c4e265ba144f19c1f646f9d8271c0702 +0 -0
  278. data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  279. data/spec/dummy/tmp/cache/assets/development/sprockets/d4c36568a5145e04bfbbefd37fecdde7 +0 -0
  280. data/spec/dummy/tmp/cache/assets/development/sprockets/d63d1c956772687b2dd2c9b43533e795 +0 -0
  281. data/spec/dummy/tmp/cache/assets/development/sprockets/d75dd624db3682fd4fed243c5f6f2e69 +0 -0
  282. data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  283. data/spec/dummy/tmp/cache/assets/development/sprockets/d7d3659361bd25606f9efaba128bf4c1 +0 -0
  284. data/spec/dummy/tmp/cache/assets/development/sprockets/d9fa58e1385bfb03f2ede65c90f36d70 +0 -0
  285. data/spec/dummy/tmp/cache/assets/development/sprockets/da8e37f2c9e3ea8f443def70515d1df0 +0 -0
  286. data/spec/dummy/tmp/cache/assets/development/sprockets/dcff3d1cd16d434b55e09399722e68be +0 -0
  287. data/spec/dummy/tmp/cache/assets/development/sprockets/e18f7bb0b671acf59ad700724547a456 +0 -0
  288. data/spec/dummy/tmp/cache/assets/development/sprockets/e459168835a5f27b832ace20874f7c10 +0 -0
  289. data/spec/dummy/tmp/cache/assets/development/sprockets/e618b87b000e1c8d606542b2a7b4936f +0 -0
  290. data/spec/dummy/tmp/cache/assets/development/sprockets/e6df0f40358bfc2568038d9cf71859a5 +0 -0
  291. data/spec/dummy/tmp/cache/assets/development/sprockets/ebe8c427280f71fed250770f7d5e0af8 +0 -0
  292. data/spec/dummy/tmp/cache/assets/development/sprockets/edefa48dfc6b66b08d68e6438d1344b4 +0 -0
  293. data/spec/dummy/tmp/cache/assets/development/sprockets/ee70ec49c833625099b94820cbfaf238 +0 -0
  294. data/spec/dummy/tmp/cache/assets/development/sprockets/eea8d1c182d93d92a52f24a90d5c92af +0 -0
  295. data/spec/dummy/tmp/cache/assets/development/sprockets/efe3e82d4fe0ca8a3427678a9cd1d070 +0 -0
  296. data/spec/dummy/tmp/cache/assets/development/sprockets/f024e5fd86a61ac8399d564f8202bbc8 +0 -0
  297. data/spec/dummy/tmp/cache/assets/development/sprockets/f12542794a06e22b1dbd97250d49deb1 +0 -0
  298. data/spec/dummy/tmp/cache/assets/development/sprockets/f34759266a45010771006dcbb608d179 +0 -0
  299. data/spec/dummy/tmp/cache/assets/development/sprockets/f466a3fe42e17653acb9980dae9be11a +0 -0
  300. data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  301. data/spec/dummy/tmp/cache/assets/development/sprockets/f86d0394f2c6bebf4ad490ce4a37d754 +0 -0
  302. data/spec/dummy/tmp/cache/assets/development/sprockets/fd5a31651e4fc8cf4a3199e8db16d53e +0 -0
  303. data/spec/dummy/tmp/cache/assets/development/sprockets/fd71e811fb40f0e16e339622af4c771f +0 -0
  304. data/spec/dummy/tmp/cache/assets/development/sprockets/fd843e12fcdd9539f8e3d7384a19bb31 +0 -0
  305. data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  306. data/spec/dummy/tmp/cache/assets/test/sprockets/19699f0bd9bbacb926aa665d057d7dcc +0 -0
  307. data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  308. data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  309. data/spec/dummy/tmp/cache/assets/test/sprockets/371bf96e99717688ed7313a0c53f4212 +0 -0
  310. data/spec/dummy/tmp/cache/assets/test/sprockets/59f25755df49e4db5915553e3d2ef412 +0 -0
  311. data/spec/dummy/tmp/cache/assets/test/sprockets/6fc757c2c8329244ca95d6909865bbc2 +0 -0
  312. data/spec/dummy/tmp/cache/assets/test/sprockets/764fdaef2f219fafc8db0923a56c23a3 +0 -0
  313. data/spec/dummy/tmp/cache/assets/test/sprockets/87172f2d7a412d1fe87d7775d589b883 +0 -0
  314. data/spec/dummy/tmp/cache/assets/test/sprockets/88741eb863751c5d5adb82282f6df5cd +0 -0
  315. data/spec/dummy/tmp/cache/assets/test/sprockets/96f8ac0ca90b5e46fb770d1695a77b2d +0 -0
  316. data/spec/dummy/tmp/cache/assets/test/sprockets/a4abc5f3fc1bfe41be3470836766d110 +0 -0
  317. data/spec/dummy/tmp/cache/assets/test/sprockets/af326fcf9b4f69ff70d3610d0696b585 +0 -0
  318. data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  319. data/spec/dummy/tmp/cache/assets/test/sprockets/d63d1c956772687b2dd2c9b43533e795 +0 -0
  320. data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  321. data/spec/dummy/tmp/cache/assets/test/sprockets/d7d3659361bd25606f9efaba128bf4c1 +0 -0
  322. data/spec/dummy/tmp/cache/assets/test/sprockets/f024e5fd86a61ac8399d564f8202bbc8 +0 -0
  323. data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  324. data/spec/dummy/tmp/cache/assets/test/sprockets/fd5a31651e4fc8cf4a3199e8db16d53e +0 -0
  325. data/spec/ext_form_spec.rb +12 -0
  326. data/spec/factories/order_header_factory.rb +22 -0
  327. data/spec/helpers/dt_picker_spec.rb +66 -0
  328. data/spec/helpers/dt_picker_tag_spec.rb +65 -0
  329. data/spec/helpers/form_helper_bs_spec.rb +102 -0
  330. data/spec/helpers/form_helper_spec.rb +109 -0
  331. data/spec/spec_helper.rb +15 -0
  332. data/spec/support/form_helper.rb +21 -0
  333. metadata +787 -0
@@ -0,0 +1,27 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require bootstrap
14
+ //= require jquery_nested_form
15
+ //= require bootstrap-datetimepicker
16
+ //= require typeahead
17
+ //= require select2
18
+ //= require locales/bootstrap-datetimepicker.zh-CN
19
+ //= require select2_locale_zh-CN
20
+ //= require ext_form/application
21
+ //= require jquery_nested_form
22
+ //= require bootstrap-datetimepicker
23
+ //= require typeahead
24
+ //= require select2
25
+ //= require ext_form/application
26
+ //= require_tree .
27
+
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,17 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require ext_form/application_bootstrap
13
+ *= require_tree .
14
+ */
15
+
16
+ @import 'bootstrap';
17
+ @import 'bootstrap-responsive';
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,56 @@
1
+ body { background-color: #fff; color: #333; }
2
+
3
+ body, p, ol, ul, td {
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ pre {
10
+ background-color: #eee;
11
+ padding: 10px;
12
+ font-size: 11px;
13
+ }
14
+
15
+ a { color: #000; }
16
+ a:visited { color: #666; }
17
+ a:hover { color: #fff; background-color:#000; }
18
+
19
+ div.field, div.actions {
20
+ margin-bottom: 10px;
21
+ }
22
+
23
+ #notice {
24
+ color: green;
25
+ }
26
+
27
+ .field_with_errors {
28
+ padding: 2px;
29
+ background-color: red;
30
+ display: table;
31
+ }
32
+
33
+ #error_explanation {
34
+ width: 450px;
35
+ border: 2px solid red;
36
+ padding: 7px;
37
+ padding-bottom: 0;
38
+ margin-bottom: 20px;
39
+ background-color: #f0f0f0;
40
+ }
41
+
42
+ #error_explanation h2 {
43
+ text-align: left;
44
+ font-weight: bold;
45
+ padding: 5px 5px 5px 15px;
46
+ font-size: 12px;
47
+ margin: -7px;
48
+ margin-bottom: 0px;
49
+ background-color: #c00;
50
+ color: #fff;
51
+ }
52
+
53
+ #error_explanation ul li {
54
+ font-size: 12px;
55
+ list-style: square;
56
+ }
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
@@ -0,0 +1,62 @@
1
+ class OrderHeadersController < ApplicationController
2
+ before_action :set_order_header, only: [:show, :edit, :update, :destroy]
3
+
4
+ # GET /order_headers
5
+ def index
6
+ @order_headers = OrderHeader.all
7
+ end
8
+
9
+ # GET /order_headers/1
10
+ def show
11
+ end
12
+
13
+ # GET /order_headers/new
14
+ def new
15
+ @order_header = OrderHeader.new
16
+
17
+ 3.times { @order_header.order_lines.build }
18
+ end
19
+
20
+ # GET /order_headers/1/edit
21
+ def edit
22
+ end
23
+
24
+ # POST /order_headers
25
+ def create
26
+ @order_header = OrderHeader.new(order_header_params)
27
+
28
+ if @order_header.save
29
+ redirect_to @order_header, notice: 'Order header was successfully created.'
30
+ else
31
+ render action: 'new'
32
+ end
33
+ end
34
+
35
+ # PATCH/PUT /order_headers/1
36
+ def update
37
+ if @order_header.update(order_header_params)
38
+ redirect_to @order_header, notice: 'Order header was successfully updated.'
39
+ else
40
+ render action: 'edit'
41
+ end
42
+ end
43
+
44
+ # DELETE /order_headers/1
45
+ def destroy
46
+ @order_header.destroy
47
+ redirect_to order_headers_url, notice: 'Order header was successfully destroyed.'
48
+ end
49
+
50
+ private
51
+ # Use callbacks to share common setup or constraints between actions.
52
+ def set_order_header
53
+ @order_header = OrderHeader.find(params[:id])
54
+ end
55
+
56
+ # Only allow a trusted parameter "white list" through.
57
+ def order_header_params
58
+ params.require(:order_header).permit(:order_number, :customer_name, :order_date, :bill_to_customer_id,
59
+ :bill_to_address, :bill_to_contact, :order_type_id,
60
+ order_lines_attributes: [:id, :item_name, :quantity, :price, :_destroy])
61
+ end
62
+ end
@@ -0,0 +1,58 @@
1
+ class OrderLinesController < ApplicationController
2
+ before_action :set_order_line, only: [:show, :edit, :update, :destroy]
3
+
4
+ # GET /order_lines
5
+ def index
6
+ @order_lines = OrderLine.all
7
+ end
8
+
9
+ # GET /order_lines/1
10
+ def show
11
+ end
12
+
13
+ # GET /order_lines/new
14
+ def new
15
+ @order_line = OrderLine.new
16
+ end
17
+
18
+ # GET /order_lines/1/edit
19
+ def edit
20
+ end
21
+
22
+ # POST /order_lines
23
+ def create
24
+ @order_line = OrderLine.new(order_line_params)
25
+
26
+ if @order_line.save
27
+ redirect_to @order_line, notice: 'Order line was successfully created.'
28
+ else
29
+ render action: 'new'
30
+ end
31
+ end
32
+
33
+ # PATCH/PUT /order_lines/1
34
+ def update
35
+ if @order_line.update(order_line_params)
36
+ redirect_to @order_line, notice: 'Order line was successfully updated.'
37
+ else
38
+ render action: 'edit'
39
+ end
40
+ end
41
+
42
+ # DELETE /order_lines/1
43
+ def destroy
44
+ @order_line.destroy
45
+ redirect_to order_lines_url, notice: 'Order line was successfully destroyed.'
46
+ end
47
+
48
+ private
49
+ # Use callbacks to share common setup or constraints between actions.
50
+ def set_order_line
51
+ @order_line = OrderLine.find(params[:id])
52
+ end
53
+
54
+ # Only allow a trusted parameter "white list" through.
55
+ def order_line_params
56
+ params.require(:order_line).permit(:order_header_id, :price, :quantity, :item_name)
57
+ end
58
+ end
@@ -0,0 +1,58 @@
1
+ class ShipmentsController < ApplicationController
2
+ before_action :set_shipment, only: [:show, :edit, :update, :destroy]
3
+
4
+ # GET /shipments
5
+ def index
6
+ @shipments = Shipment.all
7
+ end
8
+
9
+ # GET /shipments/1
10
+ def show
11
+ end
12
+
13
+ # GET /shipments/new
14
+ def new
15
+ @shipment = Shipment.new
16
+ end
17
+
18
+ # GET /shipments/1/edit
19
+ def edit
20
+ end
21
+
22
+ # POST /shipments
23
+ def create
24
+ @shipment = Shipment.new(shipment_params)
25
+
26
+ if @shipment.save
27
+ redirect_to @shipment, notice: 'Shipment was successfully created.'
28
+ else
29
+ render action: 'new'
30
+ end
31
+ end
32
+
33
+ # PATCH/PUT /shipments/1
34
+ def update
35
+ if @shipment.update(shipment_params)
36
+ redirect_to @shipment, notice: 'Shipment was successfully updated.'
37
+ else
38
+ render action: 'edit'
39
+ end
40
+ end
41
+
42
+ # DELETE /shipments/1
43
+ def destroy
44
+ @shipment.destroy
45
+ redirect_to shipments_url, notice: 'Shipment was successfully destroyed.'
46
+ end
47
+
48
+ private
49
+ # Use callbacks to share common setup or constraints between actions.
50
+ def set_shipment
51
+ @shipment = Shipment.find(params[:id])
52
+ end
53
+
54
+ # Only allow a trusted parameter "white list" through.
55
+ def shipment_params
56
+ params.require(:shipment).permit(:order_line_id, :shipping_date, :shipping_quantity, :arriving_date, :status)
57
+ end
58
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module OrderHeadersHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module OrderLinesHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module ShipmentsHelper
2
+ end
@@ -0,0 +1,9 @@
1
+ class OrderHeader < ActiveRecord::Base
2
+ has_many :order_lines
3
+ belongs_to :order_type
4
+ accepts_nested_attributes_for :order_lines, allow_destroy: true,
5
+ reject_if: proc { |attributes| attributes[:item_name].blank? }
6
+
7
+ validates :order_number, presence: true, uniqueness: true
8
+ validates :customer_name, presence: true
9
+ end
@@ -0,0 +1,6 @@
1
+ class OrderLine < ActiveRecord::Base
2
+ belongs_to :order_header
3
+ has_many :shipments
4
+
5
+ validates :item_name, :quantity, :price, presence: true
6
+ end
@@ -0,0 +1,2 @@
1
+ class OrderType < ActiveRecord::Base
2
+ end
@@ -0,0 +1,3 @@
1
+ class Shipment < ActiveRecord::Base
2
+ belongs_to :order_line
3
+ end
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
+
7
+ <script src="http://code.jquery.com/jquery-1.9.1.min.js" type="text/javascript"></script>
8
+ <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
9
+ <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
10
+ <%= csrf_meta_tags %>
11
+ </head>
12
+ <body>
13
+
14
+ <%= yield %>
15
+
16
+ </body>
17
+ </html>
@@ -0,0 +1,53 @@
1
+ <div class="container">
2
+ <%= ext_form_for @order_header do |f| %>
3
+ <%= f.hidden_field :bill_to_customer_id %>
4
+ <%= f.inputs('1') do |ff| %>
5
+ <%= ff.input :order_number %>
6
+ <%= ff.input :customer_name, as: :auto_complete,
7
+ input_html: {
8
+ data: {
9
+ dataset: {
10
+ name: 'customer',
11
+ local: [
12
+ {id: 1, value: 'GM', address: 'GM Address',
13
+ contact: 'GM contact'},
14
+ {id: 2, value: 'BMW', address: 'BMW Address',
15
+ contact: 'BMW contact'},
16
+ {id: 3, value: 'Chevrolet', address: 'Chevrolet Address',
17
+ contact: 'Chevrolet contact'},
18
+ {id: 4, value: 'Volkswagen', address: 'Volkswagen Address',
19
+ contact: 'Volkswagen contact'},
20
+ {id: 5, value: 'Mercedes', address: 'Mercedes Address',
21
+ contact: 'Mercedes contact'}
22
+ ]
23
+ },
24
+ mapping: {
25
+ id: 'order_header_bill_to_customer_id',
26
+ address: 'order_header_bill_to_address',
27
+ contact: 'order_header_bill_to_contact'
28
+ }
29
+ }
30
+ } %>
31
+ <% end %>
32
+
33
+ <%= f.inputs(:order_date, :bill_to_address, :bill_to_contact, :order_type) %>
34
+
35
+ <%= f.ext_fields_for :order_lines, l: {layout: '1:1:1'} do |l| %>
36
+ <%= l.before_row_end do %>
37
+ <div class="control-group ext-form-group">
38
+ <div class="span1">
39
+ <%= l.link_to_remove('remove', class: 'btn') %>
40
+ </div>
41
+ </div>
42
+ <% end %>
43
+
44
+ <%= l.inputs(:item_name, :quantity, :price) %>
45
+
46
+ <% end %>
47
+ <%= f.link_to_add 'add line', :order_lines, class: 'btn' %>
48
+ <div class="pull-right">
49
+ <%= f.button :submit, class: 'btn btn-primary' %>
50
+ <%= link_to 'Back', order_headers_path, class: 'btn' %>
51
+ </div>
52
+ <% end %>
53
+ </div>
@@ -0,0 +1,3 @@
1
+ <h1>Editing order_header</h1>
2
+
3
+ <%= render 'form' %>
@@ -0,0 +1,29 @@
1
+ <h1>Listing order_headers</h1>
2
+
3
+ <table>
4
+ <thead>
5
+ <tr>
6
+ <th>Order number</th>
7
+ <th>Customer name</th>
8
+ <th></th>
9
+ <th></th>
10
+ <th></th>
11
+ </tr>
12
+ </thead>
13
+
14
+ <tbody>
15
+ <% @order_headers.each do |order_header| %>
16
+ <tr>
17
+ <td><%= order_header.order_number %></td>
18
+ <td><%= order_header.customer_name %></td>
19
+ <td><%= link_to 'Show', order_header %></td>
20
+ <td><%= link_to 'Edit', edit_order_header_path(order_header) %></td>
21
+ <td><%= link_to 'Destroy', order_header, method: :delete, data: { confirm: 'Are you sure?' } %></td>
22
+ </tr>
23
+ <% end %>
24
+ </tbody>
25
+ </table>
26
+
27
+ <br>
28
+
29
+ <%= link_to 'New Order header', new_order_header_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New order_header</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+
@@ -0,0 +1,14 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Order number:</strong>
5
+ <%= @order_header.order_number %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Customer name:</strong>
10
+ <%= @order_header.customer_name %>
11
+ </p>
12
+
13
+ <%= link_to 'Edit', edit_order_header_path(@order_header) %> |
14
+ <%= link_to 'Back', order_headers_path %>
@@ -0,0 +1,33 @@
1
+ <%= form_for(@order_line) do |f| %>
2
+ <% if @order_line.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@order_line.errors.count, "error") %> prohibited this order_line from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @order_line.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :order_header_id %><br>
16
+ <%= f.number_field :order_header_id %>
17
+ </div>
18
+ <div class="field">
19
+ <%= f.label :price %><br>
20
+ <%= f.text_field :price %>
21
+ </div>
22
+ <div class="field">
23
+ <%= f.label :quantity %><br>
24
+ <%= f.text_field :quantity %>
25
+ </div>
26
+ <div class="field">
27
+ <%= f.label :item_name %><br>
28
+ <%= f.text_field :item_name %>
29
+ </div>
30
+ <div class="actions">
31
+ <%= f.submit %>
32
+ </div>
33
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing order_line</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @order_line %> |
6
+ <%= link_to 'Back', order_lines_path %>
@@ -0,0 +1,33 @@
1
+ <h1>Listing order_lines</h1>
2
+
3
+ <table>
4
+ <thead>
5
+ <tr>
6
+ <th>Order header</th>
7
+ <th>Price</th>
8
+ <th>Quantity</th>
9
+ <th>Item name</th>
10
+ <th></th>
11
+ <th></th>
12
+ <th></th>
13
+ </tr>
14
+ </thead>
15
+
16
+ <tbody>
17
+ <% @order_lines.each do |order_line| %>
18
+ <tr>
19
+ <td><%= order_line.order_header_id %></td>
20
+ <td><%= order_line.price %></td>
21
+ <td><%= order_line.quantity %></td>
22
+ <td><%= order_line.item_name %></td>
23
+ <td><%= link_to 'Show', order_line %></td>
24
+ <td><%= link_to 'Edit', edit_order_line_path(order_line) %></td>
25
+ <td><%= link_to 'Destroy', order_line, method: :delete, data: { confirm: 'Are you sure?' } %></td>
26
+ </tr>
27
+ <% end %>
28
+ </tbody>
29
+ </table>
30
+
31
+ <br>
32
+
33
+ <%= link_to 'New Order line', new_order_line_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New order_line</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', order_lines_path %>
@@ -0,0 +1,24 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Order header:</strong>
5
+ <%= @order_line.order_header_id %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Price:</strong>
10
+ <%= @order_line.price %>
11
+ </p>
12
+
13
+ <p>
14
+ <strong>Quantity:</strong>
15
+ <%= @order_line.quantity %>
16
+ </p>
17
+
18
+ <p>
19
+ <strong>Item name:</strong>
20
+ <%= @order_line.item_name %>
21
+ </p>
22
+
23
+ <%= link_to 'Edit', edit_order_line_path(@order_line) %> |
24
+ <%= link_to 'Back', order_lines_path %>
@@ -0,0 +1,37 @@
1
+ <%= form_for(@shipment) do |f| %>
2
+ <% if @shipment.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@shipment.errors.count, "error") %> prohibited this shipment from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @shipment.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :order_line_id %><br>
16
+ <%= f.number_field :order_line_id %>
17
+ </div>
18
+ <div class="field">
19
+ <%= f.label :shipping_date %><br>
20
+ <%= f.datetime_select :shipping_date %>
21
+ </div>
22
+ <div class="field">
23
+ <%= f.label :shipping_quantity %><br>
24
+ <%= f.text_field :shipping_quantity %>
25
+ </div>
26
+ <div class="field">
27
+ <%= f.label :arriving_date %><br>
28
+ <%= f.datetime_select :arriving_date %>
29
+ </div>
30
+ <div class="field">
31
+ <%= f.label :status %><br>
32
+ <%= f.text_field :status %>
33
+ </div>
34
+ <div class="actions">
35
+ <%= f.submit %>
36
+ </div>
37
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing shipment</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @shipment %> |
6
+ <%= link_to 'Back', shipments_path %>