dry_crud 1.2.5 → 1.2.6

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 (42) hide show
  1. data/README.rdoc +17 -7
  2. data/Rakefile +15 -2
  3. data/VERSION +1 -1
  4. data/lib/generators/dry_crud/templates/INSTALL +1 -1
  5. data/lib/generators/dry_crud/templates/app/controllers/crud_controller.rb +41 -27
  6. data/lib/generators/dry_crud/templates/app/controllers/list_controller.rb +2 -3
  7. data/lib/generators/dry_crud/templates/app/helpers/crud_helper.rb +33 -14
  8. data/lib/generators/dry_crud/templates/app/helpers/list_helper.rb +1 -2
  9. data/lib/generators/dry_crud/templates/app/helpers/standard_form_builder.rb +32 -3
  10. data/lib/generators/dry_crud/templates/app/helpers/standard_helper.rb +38 -20
  11. data/lib/generators/dry_crud/templates/app/views/crud/_attrs.html.erb +1 -1
  12. data/lib/generators/dry_crud/templates/app/views/crud/edit.html.erb +3 -3
  13. data/lib/generators/dry_crud/templates/app/views/crud/new.html.erb +3 -3
  14. data/lib/generators/dry_crud/templates/app/views/crud/show.html.erb +4 -2
  15. data/lib/generators/dry_crud/templates/app/views/layouts/_menu.html.erb +0 -0
  16. data/lib/generators/dry_crud/templates/app/views/layouts/crud.html.erb +22 -9
  17. data/lib/generators/dry_crud/templates/app/views/list/_search.html.erb +1 -3
  18. data/lib/generators/dry_crud/templates/app/views/list/index.html.erb +4 -4
  19. data/lib/generators/dry_crud/templates/public/images/actions/add.png +0 -0
  20. data/lib/generators/dry_crud/templates/public/images/actions/delete.png +0 -0
  21. data/lib/generators/dry_crud/templates/public/images/actions/edit.png +0 -0
  22. data/lib/generators/dry_crud/templates/public/images/actions/list.png +0 -0
  23. data/lib/generators/dry_crud/templates/public/images/actions/show.png +0 -0
  24. data/lib/generators/dry_crud/templates/public/stylesheets/crud.css +136 -18
  25. data/lib/generators/dry_crud/templates/test/crud_test_model.rb +4 -3
  26. data/lib/generators/dry_crud/templates/test/custom_assertions.rb +1 -1
  27. data/lib/generators/dry_crud/templates/test/functional/crud_test_models_controller_test.rb +21 -1
  28. data/lib/generators/dry_crud/templates/test/unit/helpers/crud_helper_test.rb +0 -5
  29. data/lib/generators/dry_crud/templates/test/unit/helpers/standard_form_builder_test.rb +22 -0
  30. data/test/templates/app/models/city.rb +13 -1
  31. data/test/templates/app/models/person.rb +1 -1
  32. data/test/templates/app/views/ajax/_actions_index.html.erb +1 -1
  33. data/test/templates/app/views/cities/_form.html.erb +1 -1
  34. data/test/templates/app/views/cities/_list.html.erb +2 -2
  35. data/test/templates/app/views/layouts/_menu.html.erb +3 -0
  36. data/test/templates/app/views/people/_attrs.html.erb +5 -7
  37. data/test/templates/config/routes.rb +2 -0
  38. data/test/templates/db/seeds.rb +5 -1
  39. data/test/templates/test/functional/cities_controller_test.rb +10 -0
  40. metadata +11 -6
  41. data/test/templates/app/views/layouts/application.html.erb +0 -33
  42. data/test/templates/public/stylesheets/demo.css +0 -113
@@ -8,18 +8,31 @@
8
8
  <%= stylesheet_link_tag 'crud' %>
9
9
  <%= javascript_include_tag :all %>
10
10
  <%= csrf_meta_tag %>
11
+ <%= yield :head %>
11
12
  </head>
12
13
  <body>
13
14
 
14
- <h1><%= @title %></h1>
15
-
16
- <% if flash[:notice].present? %>
17
- <div id="flash_notice"><%= flash[:notice] %></div>
18
- <% elsif flash[:alert].present? %>
19
- <div id="flash_alert"><%= flash[:alert] %></div>
20
- <% end %>
21
-
22
- <%= yield %>
15
+ <div id="container">
16
+ <ul id="menu">
17
+ <%= render :partial => 'layouts/menu' %>
18
+ </ul>
19
+
20
+ <h1><%= @title %></h1>
21
+
22
+ <% if flash.notice.present? %>
23
+ <div id="flash_notice"><%= flash.notice %></div>
24
+ <% elsif flash.alert.present? %>
25
+ <div id="flash_alert"><%= flash.alert %></div>
26
+ <% end %>
27
+
28
+ <div class="actions">
29
+ <%= yield :actions %>
30
+ </div>
31
+
32
+ <div id="content">
33
+ <%= yield %>
34
+ </div>
35
+ </div>
23
36
 
24
37
  </body>
25
38
  </html>
@@ -1,7 +1,5 @@
1
- <%= form_tag(nil, {:method => :get}) do %>
1
+ <%= form_tag(nil, {:method => :get, :class => 'search'}) do %>
2
2
  <%= hidden_field_tag :returning, true %>
3
3
  <%= search_field_tag :q, params[:q] %>
4
4
  <%= submit_tag 'Search' %>
5
5
  <% end %>
6
-
7
- <br/>
@@ -1,9 +1,9 @@
1
1
  <% @title ||= "Listing #{models_label}" -%>
2
2
 
3
- <%= render :partial => 'search' if search_support? %>
3
+ <% content_for(:actions, render(:partial => 'actions_index')) %>
4
4
 
5
- <%= render :partial => 'list' %>
5
+ <%= render :partial => 'search' if search_support? %>
6
6
 
7
- <br/>
7
+ <%= clear %>
8
8
 
9
- <%= render :partial => 'actions_index' %>
9
+ <%= render :partial => 'list' %>
@@ -3,17 +3,27 @@ body, div, p, td, th {
3
3
  font-size: 11pt;
4
4
  }
5
5
 
6
- td {
7
- vertical-align: top;
6
+ body {
7
+ text-align: center;
8
+ margin: 0pt;
9
+ background-color: #ddf;
8
10
  }
9
11
 
10
- table.list {}
11
-
12
- /* div rendered if no entries available for list */
13
- div.list {}
12
+ #container {
13
+ padding: 20pt 20pt;
14
+ margin: 0 auto;
15
+ text-align: left;
16
+ width: 600pt;
17
+ height: 100%;
18
+ background-color: #f6f6ff;
19
+ -moz-box-shadow: 0px 0px 10px #2580a2;
20
+ -webkit-box-shadow: 0px 0px 10px #2580a2;
21
+ box-shadow: 0px 0px 10px #2580a2;
22
+ }
14
23
 
15
- table.list th a {
16
- color: darkblue;
24
+ h1 {
25
+ font-size: 150%;
26
+ margin: 30px 0 15px 0;
17
27
  }
18
28
 
19
29
  tr.even {
@@ -24,10 +34,69 @@ tr.odd {
24
34
  background-color: #F8F8F8;
25
35
  }
26
36
 
37
+ td {
38
+ vertical-align: top;
39
+ }
40
+
27
41
  td p {
28
42
  margin: 0;
29
43
  }
30
44
 
45
+ a {
46
+ color: #2580a2;
47
+ text-decoration: none;
48
+ }
49
+
50
+ a:hover {
51
+ text-decoration: underline;
52
+ }
53
+
54
+ a:visited {
55
+ color: #2580a2;
56
+ }
57
+
58
+ a img {
59
+ border: none;
60
+ }
61
+
62
+
63
+ .list {
64
+ margin-top: 10pt;
65
+ }
66
+
67
+ table.list {
68
+ border-collapse: collapse;
69
+ width: 100%;
70
+ padding: 0;
71
+ }
72
+
73
+ /* div rendered if no entries available for list */
74
+ div.list {}
75
+
76
+ table.list th {
77
+ text-align: left;
78
+ background-color: #2580a2;
79
+ color: white;
80
+ font-weight: bold;
81
+ padding: 2px 4px;
82
+ }
83
+
84
+ table.list th a {
85
+ color: white;
86
+ text-decoration: none;
87
+ }
88
+
89
+ table.list td {
90
+ padding: 2px 4px;
91
+ }
92
+
93
+
94
+ .clear {
95
+ clear: both;
96
+ height: 0;
97
+ overflow: hidden;
98
+ }
99
+
31
100
  .right {
32
101
  text-align: right;
33
102
  }
@@ -56,31 +125,46 @@ td p {
56
125
  margin: 0px;
57
126
  }
58
127
 
59
- .attributes {}
128
+ .actions {
129
+ float: right;
130
+ }
60
131
 
61
132
  a.action {
62
- color: red;
63
- text-decoration: none;
133
+ margin-right: 10pt;
64
134
  }
65
135
 
66
- a:hover.action {
67
- text-decoration: underline;
136
+ a.action img {
137
+ vertical-align: text-top;
138
+ }
139
+
140
+ .cancel {
141
+ font-size: 80%;
142
+ margin-left: 7pt;
143
+ }
144
+
145
+ .required {
146
+ font-size: 80%;
147
+ vertical-align: top;
68
148
  }
69
149
 
70
- a:visited.action {
71
- color: red;
150
+ #flash_notice, #flash_alert {
151
+ margin: 15pt;
152
+ padding: 5pt 10pt;
72
153
  }
73
154
 
74
155
  #flash_notice {
75
156
  border: solid 2px #6a6;
76
157
  background-color: #afa;
77
- margin: 20pt;
78
- padding: 5pt 10pt;
158
+ }
159
+
160
+ #flash_alert {
161
+ border: solid 2px #da9;
162
+ background-color: #fec;
79
163
  }
80
164
 
81
165
  #error_explanation {
82
166
  border: solid 2pt #da9;
83
- margin: 20pt;
167
+ margin: 10pt;
84
168
  padding: 5pt 10pt;
85
169
  background-color: #fec;
86
170
  }
@@ -100,3 +184,37 @@ a:visited.action {
100
184
  padding: 1px 1px;
101
185
  }
102
186
 
187
+ #menu {
188
+ background: #333;
189
+ -moz-box-shadow: 0px 3px 3px #2580a2;
190
+ -webkit-box-shadow: 0px 3px 3px #2580a2;
191
+ box-shadow: 0px 3px 3px #2580a2;
192
+ float: left;
193
+ list-style: none;
194
+ margin: -20pt;
195
+ padding: 0 20px;
196
+ width: 610pt;
197
+ }
198
+
199
+ #menu li {
200
+ float: left;
201
+ font-size: 110%;
202
+ margin: 0;
203
+ padding: 0;
204
+ }
205
+
206
+ #menu a {
207
+ background: #333 bottom right no-repeat;
208
+ color: #ddd;
209
+ display: block;
210
+ float: left;
211
+ margin: 0;
212
+ padding: 4px 12px;
213
+ text-decoration: none;
214
+ }
215
+
216
+ #menu a:hover {
217
+ background: #2580a2 bottom center no-repeat;
218
+ color: #fff;
219
+ padding-bottom: 4px;
220
+ }
@@ -1,13 +1,13 @@
1
1
  # A dummy model used for general testing.
2
2
  class CrudTestModel < ActiveRecord::Base #:nodoc:
3
3
 
4
+ belongs_to :companion, :class_name => 'CrudTestModel'
5
+
4
6
  validates :name, :presence => true
5
7
  validates :rating, :inclusion => { :in => 1..10 }
6
8
 
7
9
  default_scope order('name')
8
10
 
9
- belongs_to :companion, :class_name => 'CrudTestModel'
10
-
11
11
  def label
12
12
  name
13
13
  end
@@ -68,7 +68,7 @@ class CrudTestModelsController < CrudController #:nodoc:
68
68
  end
69
69
 
70
70
  # create callback methods that record the before_render callbacks
71
- [:index, :show, :new, :edit].each do |a|
71
+ [:index, :show, :new, :edit, :form].each do |a|
72
72
  callback = "before_render_#{a.to_s}"
73
73
  send(callback.to_sym, :"#{HANDLE_PREFIX}#{callback}")
74
74
  end
@@ -110,6 +110,7 @@ module CrudTestHelper
110
110
  silence_stream(STDOUT) do
111
111
  ActiveRecord::Base.connection.create_table :crud_test_models, :force => true do |t|
112
112
  t.string :name, :null => false, :limit => 50
113
+ t.string :password
113
114
  t.string :whatever
114
115
  t.integer :children
115
116
  t.integer :companion_id
@@ -23,7 +23,7 @@ module CustomAssertions
23
23
  assert_block(full_message) { !collection.include?(element) }
24
24
  end
25
25
 
26
- # Asserts that <regexp> occurs exactly <expected> times in <string>.
26
+ # Asserts that regexp occurs exactly expected times in string.
27
27
  def assert_count(expected, regexp, string, message = "")
28
28
  actual = string.scan(regexp).size
29
29
  full_message = build_message(message, "<?> expected to occur ? time(s), but occured ? time(s) in \n<?>.",
@@ -100,9 +100,24 @@ class CrudTestModelsControllerTest < ActionController::TestCase
100
100
  assert_equal({:sort => 'chatty', :sort_dir => 'asc', :q => 'DDD'}, session[:list_params]['/crud_test_models'])
101
101
  end
102
102
 
103
+ def test_index_returning
104
+ session[:list_params] = {}
105
+ session[:list_params]['/crud_test_models'] = {:q => 'DDD', :sort => 'chatty', :sort_dir => 'desc'}
106
+ get :index, :returning => true
107
+ assert_response :success
108
+ assert_template 'index'
109
+ assert_present assigns(:entries)
110
+ assert_equal 3, assigns(:entries).size
111
+ assert_equal ['BBBBB', 'DDDDD', 'CCCCC'], assigns(:entries).collect(&:name)
112
+ assert_equal 'DDD', @controller.params[:q]
113
+ assert_equal 'chatty', @controller.params[:sort]
114
+ assert_equal 'desc', @controller.params[:sort_dir]
115
+ end
116
+
103
117
  def test_new
104
118
  super
105
119
  assert assigns(:companions)
120
+ assert_equal [:before_render_new, :before_render_form], @controller.called_callbacks
106
121
  end
107
122
 
108
123
  def test_create
@@ -110,6 +125,11 @@ class CrudTestModelsControllerTest < ActionController::TestCase
110
125
  assert_equal [:before_create, :before_save, :after_save, :after_create], @controller.called_callbacks
111
126
  end
112
127
 
128
+ def test_edit
129
+ super
130
+ assert_equal [:before_render_edit, :before_render_form], @controller.called_callbacks
131
+ end
132
+
113
133
  def test_update
114
134
  super
115
135
  assert_equal [:before_update, :before_save, :after_save, :after_update], @controller.called_callbacks
@@ -129,7 +149,7 @@ class CrudTestModelsControllerTest < ActionController::TestCase
129
149
  assert assigns(:companions)
130
150
  assert flash[:error].present?
131
151
  assert_equal 'illegal', assigns(:entry).name
132
- assert_equal [:before_render_new], @controller.called_callbacks
152
+ assert_equal [:before_render_new, :before_render_form], @controller.called_callbacks
133
153
  end
134
154
 
135
155
  def test_create_with_before_callback_redirect
@@ -91,11 +91,6 @@ class CrudHelperTest < ActionView::TestCase
91
91
  assert_match /textarea .*?name="crud_test_model\[remarks\]"/, f
92
92
  end
93
93
 
94
- test "default attributes do not include id" do
95
- assert_equal [:name, :whatever, :children, :companion_id, :rating, :income,
96
- :birthdate, :human, :remarks, :created_at, :updated_at], default_attrs
97
- end
98
-
99
94
  # Controller helper methods for the tests
100
95
 
101
96
  def model_class
@@ -23,6 +23,11 @@ class StandardFormBuilderTest < ActionView::TestCase
23
23
  assert form.string_field(:name).html_safe?
24
24
  end
25
25
 
26
+ test "input_field dispatches password attr to password_field" do
27
+ assert_equal form.password_field(:password), form.input_field(:password)
28
+ assert form.password_field(:name).html_safe?
29
+ end
30
+
26
31
  test "input_field dispatches text attr to text_area" do
27
32
  assert_equal form.text_area(:remarks), form.input_field(:remarks)
28
33
  assert form.text_area(:remarks).html_safe?
@@ -106,4 +111,21 @@ class StandardFormBuilderTest < ActionView::TestCase
106
111
  assert_match /label for.+input/m, result
107
112
  end
108
113
 
114
+ test "required mark is shown" do
115
+ assert_equal StandardFormBuilder::REQUIRED_MARK, form.required_mark(:name)
116
+ assert_nil form.required_mark(:rating)
117
+ assert_nil form.required_mark(:anything)
118
+ end
119
+
120
+ test "method missing still works" do
121
+ assert_raise(NoMethodError) do
122
+ form.blabla
123
+ end
124
+ end
125
+
126
+ test "respond to still works" do
127
+ assert !form.respond_to?(:blalba)
128
+ assert form.respond_to?(:text_field)
129
+ assert form.respond_to?(:labeled_text_field)
130
+ end
109
131
  end
@@ -2,7 +2,10 @@ class City < ActiveRecord::Base
2
2
 
3
3
  has_many :people
4
4
 
5
- validates_presence_of :name, :country_code
5
+ validates :name, :presence => true
6
+ validates :country_code, :presence => true
7
+
8
+ before_destroy :protect_with_inhabitants
6
9
 
7
10
  default_scope order('country_code, name')
8
11
 
@@ -10,4 +13,13 @@ class City < ActiveRecord::Base
10
13
  "#{name} (#{country_code})"
11
14
  end
12
15
 
16
+ protected
17
+
18
+ def protect_with_inhabitants
19
+ if people.exists?
20
+ errors.add(:base, "You cannot destroy this city as long as it has any inhabitants")
21
+ false
22
+ end
23
+ end
24
+
13
25
  end
@@ -4,6 +4,6 @@ class Person < ActiveRecord::Base
4
4
 
5
5
  belongs_to :city
6
6
 
7
- validates_presence_of :name
7
+ validates :name, :presence => true
8
8
 
9
9
  end
@@ -1,4 +1,4 @@
1
1
  <%= render :partial => 'crud/actions_index' %>
2
2
 
3
- <%= link_action 'Ajahx', {:action => 'ajax'}, :method => :get, :remote => true %>
3
+ <%= link_action 'Ajahx', nil, {:action => 'ajax'}, :method => :get, :remote => true %>
4
4
  <div id="response"></div>
@@ -1,4 +1,4 @@
1
1
  <%= crud_form do |f| -%>
2
2
  <%= f.labeled_input_field :name %>
3
- <%= f.labeled_collection_select(:country_code, ['BR', 'CH', 'DE', 'GB', 'JP', 'USA'], :to_s, :to_s, { :include_blank => "Please select" })%>
3
+ <%= f.labeled_collection_select(:country_code, ['BR', 'CH', 'DE', 'GB', 'JP', 'USA'], :to_s, :to_s, { :prompt => "Please select" })%>
4
4
  <% end -%>
@@ -1,4 +1,4 @@
1
1
  <%= crud_table *default_attrs do |t|
2
- t.col('', :class => 'center') {|e| link_action_edit(e) }
3
- t.col('', :class => 'center') {|e| link_action_destroy(e) }
2
+ action_col(t) { |e| link_table_action_edit(e) }
3
+ action_col(t) { |e| link_table_action_destroy(e) }
4
4
  end %>
@@ -0,0 +1,3 @@
1
+ <li><%= link_to 'People', people_path %></li>
2
+ <li><%= link_to 'Cities', cities_path %></li>
3
+ <li><%= link_to 'VIPs', vips_path %></li>
@@ -1,7 +1,5 @@
1
- <div class="attributes">
2
- <%= render_attrs @entry, default_attrs, false %>
3
- <%= labeled("I thinks its", "nice") %>
4
- <%= labeled("Check google") do %>
5
- <%= link_to "Maps", "http://map.google.com/?q=#{@entry.name}" %>
6
- <% end %>
7
- </div>
1
+ <%= render_attrs @entry, *default_attrs %>
2
+ <%= labeled("I thinks its", "nice") %>
3
+ <%= labeled("Check google") do %>
4
+ <%= link_to "Maps", "http://map.google.com/?q=#{@entry.name}" %>
5
+ <% end %>
@@ -13,6 +13,8 @@ TestApp::Application.routes.draw do
13
13
  end
14
14
 
15
15
  match 'vips' => 'vips#index', :as => :vips
16
+
17
+ root :to => 'people#index'
16
18
 
17
19
  # Install the default routes as the lowest priority.
18
20
  # Note: These default routes make all actions in every controller accessible via GET requests. You should
@@ -1,3 +1,5 @@
1
+ if City.count == 0
2
+
1
3
  be = City.create!(:name => 'Bern', :country_code => 'CH')
2
4
  ny = City.create!(:name => 'New York', :country_code => 'USA')
3
5
  sf = City.create!(:name => 'San Francisco', :country_code => 'USA')
@@ -52,4 +54,6 @@ Person.create!(:name => 'Andy Warhol',
52
54
  :rating => 7.5,
53
55
  :income => 123000,
54
56
  :birthdate => '1938-09-08',
55
- :remarks => 'Tomato Soup')
57
+ :remarks => 'Tomato Soup')
58
+
59
+ end
@@ -22,6 +22,16 @@ class CitiesControllerTest < ActionController::TestCase
22
22
  assert_redirected_to_index
23
23
  end
24
24
 
25
+ def test_destroy_with_inhabitants
26
+ ny = cities(:ny)
27
+ assert_no_difference('City.count') do
28
+ request.env["HTTP_REFERER"]
29
+ delete :destroy, :id => ny.id
30
+ end
31
+ assert_redirected_to :action => 'show'
32
+ assert flash.alert
33
+ end
34
+
25
35
  protected
26
36
 
27
37
  def test_entry
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry_crud
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 5
10
- version: 1.2.5
9
+ - 6
10
+ version: 1.2.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pascal Zumkehr
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-30 00:00:00 +01:00
18
+ date: 2011-02-09 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -64,6 +64,7 @@ files:
64
64
  - lib/generators/dry_crud/templates/app/views/crud/edit.html.erb
65
65
  - lib/generators/dry_crud/templates/app/views/crud/new.html.erb
66
66
  - lib/generators/dry_crud/templates/app/views/crud/show.html.erb
67
+ - lib/generators/dry_crud/templates/app/views/layouts/_menu.html.erb
67
68
  - lib/generators/dry_crud/templates/app/views/layouts/crud.html.erb
68
69
  - lib/generators/dry_crud/templates/app/views/list/_actions_index.html.erb
69
70
  - lib/generators/dry_crud/templates/app/views/list/_list.html.erb
@@ -72,6 +73,11 @@ files:
72
73
  - lib/generators/dry_crud/templates/app/views/shared/_error_messages.html.erb
73
74
  - lib/generators/dry_crud/templates/app/views/shared/_labeled.html.erb
74
75
  - lib/generators/dry_crud/templates/INSTALL
76
+ - lib/generators/dry_crud/templates/public/images/actions/add.png
77
+ - lib/generators/dry_crud/templates/public/images/actions/delete.png
78
+ - lib/generators/dry_crud/templates/public/images/actions/edit.png
79
+ - lib/generators/dry_crud/templates/public/images/actions/list.png
80
+ - lib/generators/dry_crud/templates/public/images/actions/show.png
75
81
  - lib/generators/dry_crud/templates/public/stylesheets/crud.css
76
82
  - lib/generators/dry_crud/templates/test/crud_test_model.rb
77
83
  - lib/generators/dry_crud/templates/test/custom_assertions.rb
@@ -99,13 +105,12 @@ files:
99
105
  - test/templates/app/views/cities/_form.html.erb
100
106
  - test/templates/app/views/cities/_hello.html.erb
101
107
  - test/templates/app/views/cities/_list.html.erb
102
- - test/templates/app/views/layouts/application.html.erb
108
+ - test/templates/app/views/layouts/_menu.html.erb
103
109
  - test/templates/app/views/people/_attrs.html.erb
104
110
  - test/templates/app/views/people/_list.html.erb
105
111
  - test/templates/config/routes.rb
106
112
  - test/templates/db/migrate/20100511174904_create_people_and_cities.rb
107
113
  - test/templates/db/seeds.rb
108
- - test/templates/public/stylesheets/demo.css
109
114
  - test/templates/test/fixtures/cities.yml
110
115
  - test/templates/test/fixtures/people.yml
111
116
  - test/templates/test/functional/cities_controller_test.rb
@@ -1,33 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
-
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
- <head>
6
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
7
- <title><%= @title %></title>
8
- <%= stylesheet_link_tag 'crud', 'demo' %>
9
- <%= javascript_include_tag :all %>
10
- <%= csrf_meta_tag %>
11
- </head>
12
- <body>
13
-
14
- <div id="content">
15
- <ul id="menu">
16
- <li><%= link_to 'People', people_path %></li>
17
- <li><%= link_to 'Cities', cities_path %></li>
18
- <li><%= link_to 'VIPs', vips_path %></li>
19
- </ul>
20
-
21
- <h1><%= @title %></h1>
22
-
23
- <% if flash[:notice].present? %>
24
- <div id="flash_notice"><%= flash[:notice] %></div>
25
- <% elsif flash[:alert].present? %>
26
- <div id="flash_alert"><%= flash[:alert] %></div>
27
- <% end %>
28
-
29
- <%= yield %>
30
- </div>
31
-
32
- </body>
33
- </html>