hashbrowns 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. data/.document +5 -0
  2. data/.rvmrc +1 -0
  3. data/Gemfile +17 -0
  4. data/Gemfile.lock +79 -0
  5. data/LICENSE.txt +20 -0
  6. data/README.md +9 -0
  7. data/Rakefile +53 -0
  8. data/TODO +17 -0
  9. data/VERSION +1 -0
  10. data/example/.gitignore +15 -0
  11. data/example/.rvmrc +1 -0
  12. data/example/Gemfile +45 -0
  13. data/example/Gemfile.lock +143 -0
  14. data/example/README.rdoc +261 -0
  15. data/example/Rakefile +7 -0
  16. data/example/app/assets/images/rails.png +0 -0
  17. data/example/app/assets/javascripts/application.js +16 -0
  18. data/example/app/assets/javascripts/customers.js.coffee +3 -0
  19. data/example/app/assets/javascripts/destinations.js.coffee +3 -0
  20. data/example/app/assets/javascripts/orders.js.coffee +3 -0
  21. data/example/app/assets/stylesheets/application.css.scss +25 -0
  22. data/example/app/assets/stylesheets/bootstrap_and_overrides.css.scss +3 -0
  23. data/example/app/assets/stylesheets/customers.css.scss +3 -0
  24. data/example/app/assets/stylesheets/destinations.css.scss +3 -0
  25. data/example/app/assets/stylesheets/orders.css.scss +3 -0
  26. data/example/app/assets/stylesheets/scaffolds.css.scss +69 -0
  27. data/example/app/controllers/application_controller.rb +3 -0
  28. data/example/app/controllers/customers_controller.rb +90 -0
  29. data/example/app/controllers/destinations_controller.rb +89 -0
  30. data/example/app/controllers/orders_controller.rb +88 -0
  31. data/example/app/helpers/application_helper.rb +2 -0
  32. data/example/app/helpers/customers_helper.rb +2 -0
  33. data/example/app/helpers/destinations_helper.rb +2 -0
  34. data/example/app/helpers/orders_helper.rb +2 -0
  35. data/example/app/mailers/.gitkeep +0 -0
  36. data/example/app/models/.gitkeep +0 -0
  37. data/example/app/models/customer.rb +5 -0
  38. data/example/app/models/destination.rb +4 -0
  39. data/example/app/models/order.rb +5 -0
  40. data/example/app/views/customers/_form.html.erb +33 -0
  41. data/example/app/views/customers/edit.html.erb +6 -0
  42. data/example/app/views/customers/full.rabl +2 -0
  43. data/example/app/views/customers/index.html.erb +10 -0
  44. data/example/app/views/customers/index.rabl +5 -0
  45. data/example/app/views/customers/new.html.erb +5 -0
  46. data/example/app/views/customers/show.html.erb +25 -0
  47. data/example/app/views/customers/show.rabl +5 -0
  48. data/example/app/views/destinations/_form.html.erb +41 -0
  49. data/example/app/views/destinations/edit.html.erb +6 -0
  50. data/example/app/views/destinations/full.rabl +2 -0
  51. data/example/app/views/destinations/index.html.erb +10 -0
  52. data/example/app/views/destinations/index.rabl +5 -0
  53. data/example/app/views/destinations/new.html.erb +5 -0
  54. data/example/app/views/destinations/show.html.erb +35 -0
  55. data/example/app/views/destinations/show.rabl +5 -0
  56. data/example/app/views/layouts/application.html.erb +14 -0
  57. data/example/app/views/orders/_form.html.erb +29 -0
  58. data/example/app/views/orders/edit.html.erb +6 -0
  59. data/example/app/views/orders/full.rabl +2 -0
  60. data/example/app/views/orders/index.html.erb +10 -0
  61. data/example/app/views/orders/index.rabl +5 -0
  62. data/example/app/views/orders/new.html.erb +5 -0
  63. data/example/app/views/orders/show.html.erb +20 -0
  64. data/example/app/views/orders/show.rabl +8 -0
  65. data/example/config/application.rb +62 -0
  66. data/example/config/boot.rb +6 -0
  67. data/example/config/database.yml +20 -0
  68. data/example/config/environment.rb +5 -0
  69. data/example/config/environments/development.rb +37 -0
  70. data/example/config/environments/production.rb +67 -0
  71. data/example/config/environments/test.rb +37 -0
  72. data/example/config/initializers/backtrace_silencers.rb +7 -0
  73. data/example/config/initializers/hashbrowns.rb +34 -0
  74. data/example/config/initializers/inflections.rb +15 -0
  75. data/example/config/initializers/mime_types.rb +5 -0
  76. data/example/config/initializers/secret_token.rb +7 -0
  77. data/example/config/initializers/session_store.rb +8 -0
  78. data/example/config/initializers/wrap_parameters.rb +14 -0
  79. data/example/config/locales/en.yml +5 -0
  80. data/example/config/routes.rb +64 -0
  81. data/example/config.ru +4 -0
  82. data/example/db/migrate/20121102164922_create_customers.rb +12 -0
  83. data/example/db/migrate/20121102165116_create_orders.rb +12 -0
  84. data/example/db/migrate/20121102165208_create_destinations.rb +15 -0
  85. data/example/db/schema.rb +45 -0
  86. data/example/db/seeds.rb +51 -0
  87. data/example/lib/assets/.gitkeep +0 -0
  88. data/example/lib/tasks/.gitkeep +0 -0
  89. data/example/log/.gitkeep +0 -0
  90. data/example/public/404.html +26 -0
  91. data/example/public/422.html +26 -0
  92. data/example/public/500.html +25 -0
  93. data/example/public/favicon.ico +0 -0
  94. data/example/public/index.html +241 -0
  95. data/example/public/robots.txt +5 -0
  96. data/example/script/rails +6 -0
  97. data/example/test/fixtures/.gitkeep +0 -0
  98. data/example/test/fixtures/customers.yml +13 -0
  99. data/example/test/fixtures/destinations.yml +17 -0
  100. data/example/test/fixtures/orders.yml +11 -0
  101. data/example/test/functional/.gitkeep +0 -0
  102. data/example/test/functional/customers_controller_test.rb +49 -0
  103. data/example/test/functional/destinations_controller_test.rb +49 -0
  104. data/example/test/functional/orders_controller_test.rb +49 -0
  105. data/example/test/integration/.gitkeep +0 -0
  106. data/example/test/performance/browsing_test.rb +12 -0
  107. data/example/test/test_helper.rb +13 -0
  108. data/example/test/unit/.gitkeep +0 -0
  109. data/example/test/unit/customer_test.rb +7 -0
  110. data/example/test/unit/destination_test.rb +7 -0
  111. data/example/test/unit/helpers/customers_helper_test.rb +4 -0
  112. data/example/test/unit/helpers/destinations_helper_test.rb +4 -0
  113. data/example/test/unit/helpers/orders_helper_test.rb +4 -0
  114. data/example/test/unit/order_test.rb +7 -0
  115. data/example/vendor/assets/javascripts/.gitkeep +0 -0
  116. data/example/vendor/assets/stylesheets/.gitkeep +0 -0
  117. data/example/vendor/plugins/.gitkeep +0 -0
  118. data/hashbrowns.gemspec +185 -0
  119. data/lib/hashbrowns/configuration.rb +129 -0
  120. data/lib/hashbrowns/helpers/display_helpers.rb +27 -0
  121. data/lib/hashbrowns/helpers/links_helpers.rb +24 -0
  122. data/lib/hashbrowns/helpers/overview_helpers.rb +20 -0
  123. data/lib/hashbrowns/helpers/relations_helpers.rb +9 -0
  124. data/lib/hashbrowns/helpers/renderer_helpers.rb +12 -0
  125. data/lib/hashbrowns/railtie.rb +17 -0
  126. data/lib/hashbrowns/views/hashbrowns/_overview.html.haml +20 -0
  127. data/lib/hashbrowns/views/hashbrowns/_recursive_hash_tabler.html.haml +27 -0
  128. data/lib/hashbrowns.rb +16 -0
  129. data/test/helper.rb +18 -0
  130. data/test/test_hash_tabler.rb +7 -0
  131. metadata +249 -0
@@ -0,0 +1,16 @@
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
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require bootstrap
16
+ //= require_tree .
@@ -0,0 +1,3 @@
1
+ # Place all the behaviors and hooks related to the matching controller here.
2
+ # All this logic will automatically be available in application.js.
3
+ # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,3 @@
1
+ # Place all the behaviors and hooks related to the matching controller here.
2
+ # All this logic will automatically be available in application.js.
3
+ # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,3 @@
1
+ # Place all the behaviors and hooks related to the matching controller here.
2
+ # All this logic will automatically be available in application.js.
3
+ # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
@@ -0,0 +1,25 @@
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_tree .
13
+ */
14
+
15
+ .content {
16
+ background-color: #eee;
17
+ padding: 20px;
18
+ margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
19
+ -webkit-border-radius: 0 0 6px 6px;
20
+ -moz-border-radius: 0 0 6px 6px;
21
+ border-radius: 0 0 6px 6px;
22
+ -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
23
+ -moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
24
+ box-shadow: 0 1px 2px rgba(0,0,0,.15);
25
+ }
@@ -0,0 +1,3 @@
1
+ @import "bootstrap";
2
+ body { padding-top: 60px; }
3
+ @import "bootstrap-responsive";
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the Customers controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the Destinations controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the Orders controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,69 @@
1
+ body {
2
+ background-color: #fff;
3
+ color: #333;
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ p, ol, ul, td {
10
+ font-family: verdana, arial, helvetica, sans-serif;
11
+ font-size: 13px;
12
+ line-height: 18px;
13
+ }
14
+
15
+ pre {
16
+ background-color: #eee;
17
+ padding: 10px;
18
+ font-size: 11px;
19
+ }
20
+
21
+ a {
22
+ color: #000;
23
+ &:visited {
24
+ color: #666;
25
+ }
26
+ &:hover {
27
+ color: #fff;
28
+ background-color: #000;
29
+ }
30
+ }
31
+
32
+ div {
33
+ &.field, &.actions {
34
+ margin-bottom: 10px;
35
+ }
36
+ }
37
+
38
+ #notice {
39
+ color: green;
40
+ }
41
+
42
+ .field_with_errors {
43
+ padding: 2px;
44
+ background-color: red;
45
+ display: table;
46
+ }
47
+
48
+ #error_explanation {
49
+ width: 450px;
50
+ border: 2px solid red;
51
+ padding: 7px;
52
+ padding-bottom: 0;
53
+ margin-bottom: 20px;
54
+ background-color: #f0f0f0;
55
+ h2 {
56
+ text-align: left;
57
+ font-weight: bold;
58
+ padding: 5px 5px 5px 15px;
59
+ font-size: 12px;
60
+ margin: -7px;
61
+ margin-bottom: 0px;
62
+ background-color: #c00;
63
+ color: #fff;
64
+ }
65
+ ul li {
66
+ font-size: 12px;
67
+ list-style: square;
68
+ }
69
+ }
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,90 @@
1
+ class CustomersController < ApplicationController
2
+ # GET /customers
3
+ # GET /customers.json
4
+ def index
5
+ customers = Customer.all
6
+
7
+ @customers = []
8
+ customers.each do |c|
9
+ @customers.push(c.attributes.merge({"orders" => c.orders.map{|o| o.attributes}}))
10
+ end
11
+
12
+ puts HashBrowns.conf.inspect
13
+
14
+ respond_to do |format|
15
+ format.html # index.html.erb
16
+ format.json { render :json => @customers }
17
+ end
18
+ end
19
+
20
+ # GET /customers/1
21
+ # GET /customers/1.json
22
+ def show
23
+ @customer = Customer.find(params[:id])
24
+
25
+ respond_to do |format|
26
+ format.html # show.html.erb
27
+ format.json { render :json => @customer }
28
+ end
29
+ end
30
+
31
+ # GET /customers/new
32
+ # GET /customers/new.json
33
+ def new
34
+ @customer = Customer.new
35
+
36
+ respond_to do |format|
37
+ format.html # new.html.erb
38
+ format.json { render :json => @customer }
39
+ end
40
+ end
41
+
42
+ # GET /customers/1/edit
43
+ def edit
44
+ @customer = Customer.find(params[:id])
45
+ end
46
+
47
+ # POST /customers
48
+ # POST /customers.json
49
+ def create
50
+ @customer = Customer.new(params[:customer])
51
+
52
+ respond_to do |format|
53
+ if @customer.save
54
+ format.html { redirect_to @customer, :notice => 'Customer was successfully created.' }
55
+ format.json { render :json => @customer, :status => :created, :location => @customer }
56
+ else
57
+ format.html { render :action => "new" }
58
+ format.json { render :json => @customer.errors, :status => :unprocessable_entity }
59
+ end
60
+ end
61
+ end
62
+
63
+ # PUT /customers/1
64
+ # PUT /customers/1.json
65
+ def update
66
+ @customer = Customer.find(params[:id])
67
+
68
+ respond_to do |format|
69
+ if @customer.update_attributes(params[:customer])
70
+ format.html { redirect_to @customer, :notice => 'Customer was successfully updated.' }
71
+ format.json { head :no_content }
72
+ else
73
+ format.html { render :action => "edit" }
74
+ format.json { render :json => @customer.errors, :status => :unprocessable_entity }
75
+ end
76
+ end
77
+ end
78
+
79
+ # DELETE /customers/1
80
+ # DELETE /customers/1.json
81
+ def destroy
82
+ @customer = Customer.find(params[:id])
83
+ @customer.destroy
84
+
85
+ respond_to do |format|
86
+ format.html { redirect_to customers_url }
87
+ format.json { head :no_content }
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,89 @@
1
+ class DestinationsController < ApplicationController
2
+ # GET /destinations
3
+ # GET /destinations.json
4
+ def index
5
+ puts HashBrowns.conf.inspect
6
+ destinations = Destination.all
7
+
8
+ @destinations = []
9
+ destinations.each do |d|
10
+ @destinations.push(d.attributes.merge({"order" => d.order.attributes}))
11
+ end
12
+
13
+ respond_to do |format|
14
+ format.html # index.html.erb
15
+ format.json { render :json => @destinations }
16
+ end
17
+ end
18
+
19
+ # GET /destinations/1
20
+ # GET /destinations/1.json
21
+ def show
22
+ @destination = Destination.find(params[:id])
23
+
24
+ respond_to do |format|
25
+ format.html # show.html.erb
26
+ format.json { render :json => @destination }
27
+ end
28
+ end
29
+
30
+ # GET /destinations/new
31
+ # GET /destinations/new.json
32
+ def new
33
+ @destination = Destination.new
34
+
35
+ respond_to do |format|
36
+ format.html # new.html.erb
37
+ format.json { render :json => @destination }
38
+ end
39
+ end
40
+
41
+ # GET /destinations/1/edit
42
+ def edit
43
+ @destination = Destination.find(params[:id])
44
+ end
45
+
46
+ # POST /destinations
47
+ # POST /destinations.json
48
+ def create
49
+ @destination = Destination.new(params[:destination])
50
+
51
+ respond_to do |format|
52
+ if @destination.save
53
+ format.html { redirect_to @destination, :notice => 'Destination was successfully created.' }
54
+ format.json { render :json => @destination, :status => :created, :location => @destination }
55
+ else
56
+ format.html { render :action => "new" }
57
+ format.json { render :json => @destination.errors, :status => :unprocessable_entity }
58
+ end
59
+ end
60
+ end
61
+
62
+ # PUT /destinations/1
63
+ # PUT /destinations/1.json
64
+ def update
65
+ @destination = Destination.find(params[:id])
66
+
67
+ respond_to do |format|
68
+ if @destination.update_attributes(params[:destination])
69
+ format.html { redirect_to @destination, :notice => 'Destination was successfully updated.' }
70
+ format.json { head :no_content }
71
+ else
72
+ format.html { render :action => "edit" }
73
+ format.json { render :json => @destination.errors, :status => :unprocessable_entity }
74
+ end
75
+ end
76
+ end
77
+
78
+ # DELETE /destinations/1
79
+ # DELETE /destinations/1.json
80
+ def destroy
81
+ @destination = Destination.find(params[:id])
82
+ @destination.destroy
83
+
84
+ respond_to do |format|
85
+ format.html { redirect_to destinations_url }
86
+ format.json { head :no_content }
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,88 @@
1
+ class OrdersController < ApplicationController
2
+ # GET /orders
3
+ # GET /orders.json
4
+ def index
5
+ orders = Order.all
6
+
7
+ @orders = []
8
+ orders.each do |o|
9
+ @orders.push(o.attributes.merge({"customer" => o.customer.attributes, "destinations" => o.destinations.map(&:attributes)}))
10
+ end
11
+
12
+ respond_to do |format|
13
+ format.html # index.html.erb
14
+ format.json { render :json => @orders }
15
+ end
16
+ end
17
+
18
+ # GET /orders/1
19
+ # GET /orders/1.json
20
+ def show
21
+ @order = Order.find(params[:id])
22
+
23
+ respond_to do |format|
24
+ format.html # show.html.erb
25
+ format.json { render :json => @order }
26
+ end
27
+ end
28
+
29
+ # GET /orders/new
30
+ # GET /orders/new.json
31
+ def new
32
+ @order = Order.new
33
+
34
+ respond_to do |format|
35
+ format.html # new.html.erb
36
+ format.json { render :json => @order }
37
+ end
38
+ end
39
+
40
+ # GET /orders/1/edit
41
+ def edit
42
+ @order = Order.find(params[:id])
43
+ end
44
+
45
+ # POST /orders
46
+ # POST /orders.json
47
+ def create
48
+ @order = Order.new(params[:order])
49
+
50
+ respond_to do |format|
51
+ if @order.save
52
+ format.html { redirect_to @order, :notice => 'Order was successfully created.' }
53
+ format.json { render :json => @order, :status => :created, :location => @order }
54
+ else
55
+ format.html { render :action => "new" }
56
+ format.json { render :json => @order.errors, :status => :unprocessable_entity }
57
+ end
58
+ end
59
+ end
60
+
61
+ # PUT /orders/1
62
+ # PUT /orders/1.json
63
+ def update
64
+ @order = Order.find(params[:id])
65
+
66
+ respond_to do |format|
67
+ if @order.update_attributes(params[:order])
68
+ format.html { redirect_to @order, :notice => 'Order was successfully updated.' }
69
+ format.json { head :no_content }
70
+ else
71
+ format.html { render :action => "edit" }
72
+ format.json { render :json => @order.errors, :status => :unprocessable_entity }
73
+ end
74
+ end
75
+ end
76
+
77
+ # DELETE /orders/1
78
+ # DELETE /orders/1.json
79
+ def destroy
80
+ @order = Order.find(params[:id])
81
+ @order.destroy
82
+
83
+ respond_to do |format|
84
+ format.html { redirect_to orders_url }
85
+ format.json { head :no_content }
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module CustomersHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module DestinationsHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module OrdersHelper
2
+ end
File without changes
File without changes
@@ -0,0 +1,5 @@
1
+ class Customer < ActiveRecord::Base
2
+ attr_accessible :email_address, :first_name, :last_name, :phone
3
+
4
+ has_many :orders
5
+ end
@@ -0,0 +1,4 @@
1
+ class Destination < ActiveRecord::Base
2
+ attr_accessible :address1, :address2, :city, :phone, :state, :zip
3
+ belongs_to :order
4
+ end
@@ -0,0 +1,5 @@
1
+ class Order < ActiveRecord::Base
2
+ attr_accessible :description, :name, :status
3
+ has_many :destinations
4
+ belongs_to :customer
5
+ end
@@ -0,0 +1,33 @@
1
+ <%= form_for(@customer) do |f| %>
2
+ <% if @customer.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@customer.errors.count, "error") %> prohibited this customer from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @customer.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 :first_name %><br />
16
+ <%= f.text_field :first_name %>
17
+ </div>
18
+ <div class="field">
19
+ <%= f.label :last_name %><br />
20
+ <%= f.text_field :last_name %>
21
+ </div>
22
+ <div class="field">
23
+ <%= f.label :email_address %><br />
24
+ <%= f.text_field :email_address %>
25
+ </div>
26
+ <div class="field">
27
+ <%= f.label :phone %><br />
28
+ <%= f.text_field :phone %>
29
+ </div>
30
+ <div class="actions">
31
+ <%= f.submit %>
32
+ </div>
33
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing customer</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @customer %> |
6
+ <%= link_to 'Back', customers_path %>
@@ -0,0 +1,2 @@
1
+ object @customer
2
+ attributes :id, :first_name, :last_name, :email_address, :phone, :created_at, :updated_at
@@ -0,0 +1,10 @@
1
+ <h1>Listing customers</h1>
2
+
3
+ <h5>Summary</h5>
4
+ <%= render_hash_to_overview(:customers, @customers) %>
5
+ <h5>Payload</h5>
6
+ <%= render_hash_to_table(@customers) %>
7
+
8
+ <br />
9
+
10
+ <%= link_to 'New Customer', new_customer_path %>
@@ -0,0 +1,5 @@
1
+ collection @customers
2
+ extends "customers/full"
3
+ child :order do
4
+ extends "orders/full"
5
+ end
@@ -0,0 +1,5 @@
1
+ <h1>New customer</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', customers_path %>
@@ -0,0 +1,25 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <b>First name:</b>
5
+ <%= @customer.first_name %>
6
+ </p>
7
+
8
+ <p>
9
+ <b>Last name:</b>
10
+ <%= @customer.last_name %>
11
+ </p>
12
+
13
+ <p>
14
+ <b>Email address:</b>
15
+ <%= @customer.email_address %>
16
+ </p>
17
+
18
+ <p>
19
+ <b>Phone:</b>
20
+ <%= @customer.phone %>
21
+ </p>
22
+
23
+
24
+ <%= link_to 'Edit', edit_customer_path(@customer) %> |
25
+ <%= link_to 'Back', customers_path %>
@@ -0,0 +1,5 @@
1
+ object @customer
2
+ extends "customers/full"
3
+ child :orders do
4
+ extends "orders/full"
5
+ end
@@ -0,0 +1,41 @@
1
+ <%= form_for(@destination) do |f| %>
2
+ <% if @destination.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@destination.errors.count, "error") %> prohibited this destination from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @destination.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 :address1 %><br />
16
+ <%= f.text_field :address1 %>
17
+ </div>
18
+ <div class="field">
19
+ <%= f.label :address2 %><br />
20
+ <%= f.text_field :address2 %>
21
+ </div>
22
+ <div class="field">
23
+ <%= f.label :city %><br />
24
+ <%= f.text_field :city %>
25
+ </div>
26
+ <div class="field">
27
+ <%= f.label :state %><br />
28
+ <%= f.text_field :state %>
29
+ </div>
30
+ <div class="field">
31
+ <%= f.label :zip %><br />
32
+ <%= f.text_field :zip %>
33
+ </div>
34
+ <div class="field">
35
+ <%= f.label :phone %><br />
36
+ <%= f.text_field :phone %>
37
+ </div>
38
+ <div class="actions">
39
+ <%= f.submit %>
40
+ </div>
41
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing destination</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @destination %> |
6
+ <%= link_to 'Back', destinations_path %>
@@ -0,0 +1,2 @@
1
+ object @destination
2
+ attributes :id, :address1, :address2, :city, :state, :zip, :phone, :order_id, :created_at, :updated_at
@@ -0,0 +1,10 @@
1
+ <h1>Listing destinations</h1>
2
+
3
+ <h5>Summary</h5>
4
+ <%= render_hash_to_overview(:destinations, @destinations) %>
5
+ <h5>Payload</h5>
6
+ <%= render_hash_to_table(@destinations) %>
7
+
8
+ <br />
9
+
10
+ <%= link_to 'New Destination', new_destination_path %>
@@ -0,0 +1,5 @@
1
+ collection @destinations
2
+ extends "destinations/full"
3
+ child :order do
4
+ extends "orders/full"
5
+ end
@@ -0,0 +1,5 @@
1
+ <h1>New destination</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', destinations_path %>