stefanpenner-shoulda_generator 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/rails_generators/shoulda_model/USAGE +27 -0
- data/rails_generators/shoulda_model/shoulda_model_generator.rb +49 -0
- data/rails_generators/shoulda_model/templates/factory.rb +5 -0
- data/rails_generators/shoulda_model/templates/fixtures.yml +19 -0
- data/rails_generators/shoulda_model/templates/migration.rb +16 -0
- data/rails_generators/shoulda_model/templates/model.rb +2 -0
- data/rails_generators/shoulda_model/templates/unit_test.rb +7 -0
- data/rails_generators/shoulda_scaffold/USAGE +34 -0
- data/rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb +168 -0
- data/rails_generators/shoulda_scaffold/templates/blueprint/ie.css +22 -0
- data/rails_generators/shoulda_scaffold/templates/blueprint/print.css +29 -0
- data/rails_generators/shoulda_scaffold/templates/blueprint/screen.css +226 -0
- data/rails_generators/shoulda_scaffold/templates/controller.rb +46 -0
- data/rails_generators/shoulda_scaffold/templates/erb/_form.html.erb +8 -0
- data/rails_generators/shoulda_scaffold/templates/erb/edit.html.erb +12 -0
- data/rails_generators/shoulda_scaffold/templates/erb/index.html.erb +22 -0
- data/rails_generators/shoulda_scaffold/templates/erb/layout.html.erb +22 -0
- data/rails_generators/shoulda_scaffold/templates/erb/new.html.erb +8 -0
- data/rails_generators/shoulda_scaffold/templates/erb/show.html.erb +12 -0
- data/rails_generators/shoulda_scaffold/templates/functional_test/basic.rb +66 -0
- data/rails_generators/shoulda_scaffold/templates/functional_test/should_be_restful.rb +13 -0
- data/rails_generators/shoulda_scaffold/templates/haml/_form.html.haml +5 -0
- data/rails_generators/shoulda_scaffold/templates/haml/edit.html.haml +9 -0
- data/rails_generators/shoulda_scaffold/templates/haml/index.html.haml +18 -0
- data/rails_generators/shoulda_scaffold/templates/haml/layout.html.haml +13 -0
- data/rails_generators/shoulda_scaffold/templates/haml/new.html.haml +7 -0
- data/rails_generators/shoulda_scaffold/templates/haml/show.html.haml +9 -0
- data/rails_generators/shoulda_scaffold/templates/helper.rb +2 -0
- data/test/fixtures/tmp/test.log +1 -0
- metadata +29 -1
@@ -0,0 +1,27 @@
|
|
1
|
+
Description:
|
2
|
+
Stubs out a new model. Pass the model name, either CamelCased or
|
3
|
+
under_scored, and an optional list of attribute pairs as arguments.
|
4
|
+
|
5
|
+
Attribute pairs are column_name:sql_type arguments specifying the
|
6
|
+
model's attributes. Timestamps are added by default, so you don't have to
|
7
|
+
specify them by hand as 'created_at:datetime updated_at:datetime'.
|
8
|
+
|
9
|
+
You don't have to think up every attribute up front, but it helps to
|
10
|
+
sketch out a few so you can start working with the model immediately.
|
11
|
+
|
12
|
+
This generates a model class in app/models, a unit test in test/unit,
|
13
|
+
a test fixture in test/fixtures/singular_name.yml, and a migration in
|
14
|
+
db/migrate.
|
15
|
+
|
16
|
+
Examples:
|
17
|
+
`./script/generate shoulda_model account`
|
18
|
+
|
19
|
+
creates an Account model, test, factory, and migration:
|
20
|
+
Model: app/models/account.rb
|
21
|
+
Test: test/unit/account_test.rb
|
22
|
+
Factory: test/factories/account_factory.rb
|
23
|
+
Migration: db/migrate/XXX_add_accounts.rb
|
24
|
+
|
25
|
+
`./script/generate shoulda_model post title:string body:text published:boolean`
|
26
|
+
|
27
|
+
creates a Post model with a string title, text body, and published flag.
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class ShouldaModelGenerator < Rails::Generator::NamedBase
|
2
|
+
default_options :skip_timestamps => false, :skip_migration => false, :skip_factory => false
|
3
|
+
|
4
|
+
def manifest
|
5
|
+
record do |m|
|
6
|
+
# Check for class naming collisions.
|
7
|
+
m.class_collisions class_path, class_name, "#{class_name}Test"
|
8
|
+
|
9
|
+
# Model, test, and fixture directories.
|
10
|
+
m.directory File.join('app/models', class_path)
|
11
|
+
m.directory File.join('test/unit', class_path)
|
12
|
+
m.directory File.join('test/factories', class_path)
|
13
|
+
|
14
|
+
# Model class, unit test, and fixtures.
|
15
|
+
m.template 'model.rb', File.join('app/models', class_path, "#{file_name}.rb")
|
16
|
+
m.template 'unit_test.rb', File.join('test/unit', class_path, "#{file_name}_test.rb")
|
17
|
+
|
18
|
+
unless options[:skip_factory]
|
19
|
+
m.template 'factory.rb', File.join('test/factories', class_path, "#{file_name}_factory.rb")
|
20
|
+
end
|
21
|
+
|
22
|
+
unless options[:skip_migration]
|
23
|
+
m.migration_template 'migration.rb', 'db/migrate', :assigns => {
|
24
|
+
:migration_name => "Create#{class_name.pluralize.gsub(/::/, '')}"
|
25
|
+
}, :migration_file_name => "create_#{file_path.gsub(/\//, '_').pluralize}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def factory_line(attribute)
|
31
|
+
"#{file_name}.#{attribute.name} '#{attribute.default}'"
|
32
|
+
end
|
33
|
+
|
34
|
+
protected
|
35
|
+
def banner
|
36
|
+
"Usage: #{$0} #{spec.name} ModelName [field:type, field:type]"
|
37
|
+
end
|
38
|
+
|
39
|
+
def add_options!(opt)
|
40
|
+
opt.separator ''
|
41
|
+
opt.separator 'Options:'
|
42
|
+
opt.on("--skip-timestamps",
|
43
|
+
"Don't add timestamps to the migration file for this model") { |v| options[:skip_timestamps] = v }
|
44
|
+
opt.on("--skip-migration",
|
45
|
+
"Don't generate a migration file for this model") { |v| options[:skip_migration] = v }
|
46
|
+
opt.on("--skip-factory",
|
47
|
+
"Don't generation a fixture file for this model") { |v| options[:skip_factory] = v}
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
|
2
|
+
|
3
|
+
<% unless attributes.empty? -%>
|
4
|
+
one:
|
5
|
+
<% for attribute in attributes -%>
|
6
|
+
<%= attribute.name %>: <%= attribute.default %>
|
7
|
+
<% end -%>
|
8
|
+
|
9
|
+
two:
|
10
|
+
<% for attribute in attributes -%>
|
11
|
+
<%= attribute.name %>: <%= attribute.default %>
|
12
|
+
<% end -%>
|
13
|
+
<% else -%>
|
14
|
+
# one:
|
15
|
+
# column: value
|
16
|
+
#
|
17
|
+
# two:
|
18
|
+
# column: value
|
19
|
+
<% end -%>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class <%= migration_name %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :<%= table_name %> do |t|
|
4
|
+
<% for attribute in attributes -%>
|
5
|
+
t.<%= attribute.type %> :<%= attribute.name %>
|
6
|
+
<% end -%>
|
7
|
+
<% unless options[:skip_timestamps] %>
|
8
|
+
t.timestamps
|
9
|
+
<% end -%>
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.down
|
14
|
+
drop_table :<%= table_name %>
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
Description:
|
2
|
+
Scaffolds an entire resource, from model and migration to controller and
|
3
|
+
views, along with a full test suite. The resource is ready to use as a
|
4
|
+
starting point for your restful, resource-oriented application.
|
5
|
+
|
6
|
+
Pass the name of the model, either CamelCased or under_scored, as the first
|
7
|
+
argument, and an optional list of attribute pairs.
|
8
|
+
|
9
|
+
Attribute pairs are column_name:sql_type arguments specifying the
|
10
|
+
model's attributes. Timestamps are added by default, so you don't have to
|
11
|
+
specify them by hand as 'created_at:datetime updated_at:datetime'.
|
12
|
+
|
13
|
+
You don't have to think up every attribute up front, but it helps to
|
14
|
+
sketch out a few so you can start working with the resource immediately.
|
15
|
+
|
16
|
+
For example, `scaffold post title:string body:text published:boolean`
|
17
|
+
gives you a model with those three attributes, a controller that handles
|
18
|
+
the create/show/update/destroy, forms to create and edit your posts, and
|
19
|
+
an index that lists them all, as well as a map.resources :posts
|
20
|
+
declaration in config/routes.rb.
|
21
|
+
|
22
|
+
You can override the default values for templating and
|
23
|
+
functional\_test\_style by placing a .shoulda\_generator file in your home
|
24
|
+
directory.
|
25
|
+
|
26
|
+
Here's an example `.shoulda_generator`:
|
27
|
+
|
28
|
+
:templating: erb # supported options: haml|erb
|
29
|
+
:functional_test_syle: basic # supported options: should_be_restful|basic
|
30
|
+
|
31
|
+
Examples:
|
32
|
+
`./script/generate shoulda_scaffold post` # no attributes, view will be anemic
|
33
|
+
`./script/generate shoulda_scaffold post title:string body:text published:boolean`
|
34
|
+
`./script/generate shoulda_scaffold purchase order_id:integer amount:decimal`
|
@@ -0,0 +1,168 @@
|
|
1
|
+
#--
|
2
|
+
# ShouldaScaffoldGeneratorConfig based on rubygems code.
|
3
|
+
# Thank you Chad Fowler, Rich Kilmer, Jim Weirich and others.
|
4
|
+
#++
|
5
|
+
class ShouldaScaffoldGeneratorConfig
|
6
|
+
|
7
|
+
DEFAULT_TEMPLATING = 'haml'
|
8
|
+
DEFAULT_FUNCTIONAL_TEST_STYLE = 'should_be_restful'
|
9
|
+
|
10
|
+
def initialize()
|
11
|
+
@config = load_file(config_file)
|
12
|
+
|
13
|
+
@templating = @config[:templating] || DEFAULT_TEMPLATING
|
14
|
+
@functional_test_style = @config[:functional_test_style] || DEFAULT_FUNCTIONAL_TEST_STYLE
|
15
|
+
end
|
16
|
+
|
17
|
+
attr_reader :templating, :functional_test_style
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def load_file(filename)
|
22
|
+
begin
|
23
|
+
YAML.load(File.read(filename)) if filename and File.exist?(filename)
|
24
|
+
rescue ArgumentError
|
25
|
+
warn "Failed to load #{config_file_name}"
|
26
|
+
rescue Errno::EACCES
|
27
|
+
warn "Failed to load #{config_file_name} due to permissions problem."
|
28
|
+
end or {}
|
29
|
+
end
|
30
|
+
|
31
|
+
def config_file
|
32
|
+
File.join(find_home, '.shoulda_generator')
|
33
|
+
end
|
34
|
+
|
35
|
+
##
|
36
|
+
# Finds the user's home directory.
|
37
|
+
|
38
|
+
def find_home
|
39
|
+
['HOME', 'USERPROFILE'].each do |homekey|
|
40
|
+
return ENV[homekey] if ENV[homekey]
|
41
|
+
end
|
42
|
+
|
43
|
+
if ENV['HOMEDRIVE'] && ENV['HOMEPATH'] then
|
44
|
+
return "#{ENV['HOMEDRIVE']}:#{ENV['HOMEPATH']}"
|
45
|
+
end
|
46
|
+
|
47
|
+
begin
|
48
|
+
File.expand_path("~")
|
49
|
+
rescue
|
50
|
+
if File::ALT_SEPARATOR then
|
51
|
+
"C:/"
|
52
|
+
else
|
53
|
+
"/"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
class ShouldaScaffoldGenerator < Rails::Generator::NamedBase
|
60
|
+
default_options :skip_timestamps => false, :skip_migration => false, :skip_layout => true
|
61
|
+
|
62
|
+
attr_reader :controller_name,
|
63
|
+
:controller_class_path,
|
64
|
+
:controller_file_path,
|
65
|
+
:controller_class_nesting,
|
66
|
+
:controller_class_nesting_depth,
|
67
|
+
:controller_class_name,
|
68
|
+
:controller_underscore_name,
|
69
|
+
:controller_singular_name,
|
70
|
+
:controller_plural_name
|
71
|
+
alias_method :controller_file_name, :controller_underscore_name
|
72
|
+
alias_method :controller_table_name, :controller_plural_name
|
73
|
+
|
74
|
+
def initialize(runtime_args, runtime_options = {})
|
75
|
+
super
|
76
|
+
|
77
|
+
@configuration = ShouldaScaffoldGeneratorConfig.new
|
78
|
+
|
79
|
+
@controller_name = @name.pluralize
|
80
|
+
|
81
|
+
base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(@controller_name)
|
82
|
+
@controller_class_name_without_nesting, @controller_underscore_name, @controller_plural_name = inflect_names(base_name)
|
83
|
+
@controller_singular_name=base_name.singularize
|
84
|
+
if @controller_class_nesting.empty?
|
85
|
+
@controller_class_name = @controller_class_name_without_nesting
|
86
|
+
else
|
87
|
+
@controller_class_name = "#{@controller_class_nesting}::#{@controller_class_name_without_nesting}"
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
def manifest
|
92
|
+
record do |m|
|
93
|
+
# Check for class naming collisions.
|
94
|
+
m.class_collisions(controller_class_path, "#{controller_class_name}Controller", "#{controller_class_name}Helper")
|
95
|
+
m.class_collisions(class_path, "#{class_name}")
|
96
|
+
|
97
|
+
# Controller, helper, views, and test directories.
|
98
|
+
m.directory(File.join('app/models', class_path))
|
99
|
+
m.directory(File.join('app/controllers', controller_class_path))
|
100
|
+
m.directory(File.join('app/helpers', controller_class_path))
|
101
|
+
m.directory(File.join('app/views', controller_class_path, controller_file_name))
|
102
|
+
m.directory(File.join('app/views/layouts', controller_class_path))
|
103
|
+
m.directory(File.join('test/functional', controller_class_path))
|
104
|
+
m.directory(File.join('test/unit', class_path))
|
105
|
+
|
106
|
+
m.directory('public/stylesheets/blueprint')
|
107
|
+
|
108
|
+
for view in scaffold_views
|
109
|
+
m.template(
|
110
|
+
"#{templating}/#{view}.html.#{templating}",
|
111
|
+
File.join('app/views', controller_class_path, controller_file_name, "#{view}.html.#{templating}")
|
112
|
+
)
|
113
|
+
end
|
114
|
+
|
115
|
+
# Layout and stylesheet.
|
116
|
+
m.template("#{templating}/layout.html.#{templating}", File.join('app/views/layouts', controller_class_path, "#{controller_file_name}.html.#{templating}"))
|
117
|
+
|
118
|
+
%w(print screen ie).each do |stylesheet|
|
119
|
+
m.template("blueprint/#{stylesheet}.css", "public/stylesheets/blueprint/#{stylesheet}.css")
|
120
|
+
end
|
121
|
+
|
122
|
+
m.template(
|
123
|
+
'controller.rb', File.join('app/controllers', controller_class_path, "#{controller_file_name}_controller.rb")
|
124
|
+
)
|
125
|
+
|
126
|
+
m.template("functional_test/#{functional_test_style}.rb", File.join('test/functional', controller_class_path, "#{controller_file_name}_controller_test.rb"))
|
127
|
+
m.template('helper.rb', File.join('app/helpers', controller_class_path, "#{controller_file_name}_helper.rb"))
|
128
|
+
|
129
|
+
m.route_resources controller_file_name
|
130
|
+
|
131
|
+
m.dependency 'shoulda_model', [name] + @args, :collision => :skip
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
def templating
|
136
|
+
options[:templating] || @configuration.templating
|
137
|
+
end
|
138
|
+
|
139
|
+
def functional_test_style
|
140
|
+
options[:functional_test_style] || @configuration.functional_test_style
|
141
|
+
end
|
142
|
+
|
143
|
+
protected
|
144
|
+
# Override with your own usage banner.
|
145
|
+
def banner
|
146
|
+
"Usage: #{$0} scaffold ModelName [field:type, field:type]"
|
147
|
+
end
|
148
|
+
|
149
|
+
def add_options!(opt)
|
150
|
+
opt.separator ''
|
151
|
+
opt.separator 'Options:'
|
152
|
+
opt.on("--skip-timestamps",
|
153
|
+
"Don't add timestamps to the migration file for this model") { |v| options[:skip_timestamps] = v }
|
154
|
+
opt.on("--skip-migration",
|
155
|
+
"Don't generate a migration file for this model") { |v| options[:skip_migration] = v }
|
156
|
+
opt.on("--templating [erb|haml]", "Specify the templating to use (haml by default)") { |v| options[:templating] = v }
|
157
|
+
opt.on("--functional-test-style [basic|should_be_restful]", "Specify the style of the functional test (should_be_restful by default)") { |v| options[:functional_test_style] = v }
|
158
|
+
|
159
|
+
end
|
160
|
+
|
161
|
+
def scaffold_views
|
162
|
+
%w[ index show new edit _form ]
|
163
|
+
end
|
164
|
+
|
165
|
+
def model_name
|
166
|
+
class_name.demodulize
|
167
|
+
end
|
168
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
/* -----------------------------------------------------------------------
|
2
|
+
|
3
|
+
Blueprint CSS Framework 0.7.1
|
4
|
+
http://blueprintcss.googlecode.com
|
5
|
+
|
6
|
+
* Copyright (c) 2007-2008. See LICENSE for more info.
|
7
|
+
* See README for instructions on how to use Blueprint.
|
8
|
+
* For credits and origins, see AUTHORS.
|
9
|
+
* This is a compressed file. See the sources in the 'src' directory.
|
10
|
+
|
11
|
+
----------------------------------------------------------------------- */
|
12
|
+
|
13
|
+
/* ie.css */
|
14
|
+
body {text-align:center;}
|
15
|
+
.container {text-align:left;}
|
16
|
+
* html .column {overflow-x:hidden;}
|
17
|
+
* html legend {margin:-18px -8px 16px 0;padding:0;}
|
18
|
+
ol {margin-left:2em;}
|
19
|
+
sup {vertical-align:text-top;}
|
20
|
+
sub {vertical-align:text-bottom;}
|
21
|
+
html>body p code {*white-space:normal;}
|
22
|
+
hr {margin:-8px auto 11px;}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
/* -----------------------------------------------------------------------
|
2
|
+
|
3
|
+
Blueprint CSS Framework 0.7.1
|
4
|
+
http://blueprintcss.googlecode.com
|
5
|
+
|
6
|
+
* Copyright (c) 2007-2008. See LICENSE for more info.
|
7
|
+
* See README for instructions on how to use Blueprint.
|
8
|
+
* For credits and origins, see AUTHORS.
|
9
|
+
* This is a compressed file. See the sources in the 'src' directory.
|
10
|
+
|
11
|
+
----------------------------------------------------------------------- */
|
12
|
+
|
13
|
+
/* print.css */
|
14
|
+
body {line-height:1.5;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;color:#000;background:none;font-size:10pt;}
|
15
|
+
.container {background:none;}
|
16
|
+
hr {background:#ccc;color:#ccc;width:100%;height:2px;margin:2em 0;padding:0;border:none;}
|
17
|
+
hr.space {background:#fff;color:#fff;}
|
18
|
+
h1, h2, h3, h4, h5, h6 {font-family:"Helvetica Neue", Arial, "Lucida Grande", sans-serif;}
|
19
|
+
code {font:.9em "Courier New", Monaco, Courier, monospace;}
|
20
|
+
img {float:left;margin:1.5em 1.5em 1.5em 0;}
|
21
|
+
a img {border:none;}
|
22
|
+
p img.top {margin-top:0;}
|
23
|
+
blockquote {margin:1.5em;padding:1em;font-style:italic;font-size:.9em;}
|
24
|
+
.small {font-size:.9em;}
|
25
|
+
.large {font-size:1.1em;}
|
26
|
+
.quiet {color:#999;}
|
27
|
+
.hide {display:none;}
|
28
|
+
a:link, a:visited {background:transparent;font-weight:700;text-decoration:underline;}
|
29
|
+
a:link:after, a:visited:after {content:" (" attr(href) ") ";font-size:90%;}
|
@@ -0,0 +1,226 @@
|
|
1
|
+
/* -----------------------------------------------------------------------
|
2
|
+
|
3
|
+
Blueprint CSS Framework 0.7.1
|
4
|
+
http://blueprintcss.googlecode.com
|
5
|
+
|
6
|
+
* Copyright (c) 2007-2008. See LICENSE for more info.
|
7
|
+
* See README for instructions on how to use Blueprint.
|
8
|
+
* For credits and origins, see AUTHORS.
|
9
|
+
* This is a compressed file. See the sources in the 'src' directory.
|
10
|
+
|
11
|
+
----------------------------------------------------------------------- */
|
12
|
+
|
13
|
+
/* reset.css */
|
14
|
+
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;}
|
15
|
+
body {line-height:1.5;}
|
16
|
+
table {border-collapse:separate;border-spacing:0;}
|
17
|
+
caption, th, td {text-align:left;font-weight:normal;}
|
18
|
+
table, td, th {vertical-align:middle;}
|
19
|
+
blockquote:before, blockquote:after, q:before, q:after {content:"";}
|
20
|
+
blockquote, q {quotes:"" "";}
|
21
|
+
a img {border:none;}
|
22
|
+
|
23
|
+
/* typography.css */
|
24
|
+
body {font-size:75%;color:#222;background:#fff;font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;}
|
25
|
+
h1, h2, h3, h4, h5, h6 {font-weight:normal;color:#111;}
|
26
|
+
h1 {font-size:3em;line-height:1;margin-bottom:0.5em;}
|
27
|
+
h2 {font-size:2em;margin-bottom:0.75em;}
|
28
|
+
h3 {font-size:1.5em;line-height:1;margin-bottom:1em;}
|
29
|
+
h4 {font-size:1.2em;line-height:1.25;margin-bottom:1.25em;height:1.25em;}
|
30
|
+
h5 {font-size:1em;font-weight:bold;margin-bottom:1.5em;}
|
31
|
+
h6 {font-size:1em;font-weight:bold;}
|
32
|
+
h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {margin:0;}
|
33
|
+
p {margin:0 0 1.5em;}
|
34
|
+
p img {float:left;margin:1.5em 1.5em 1.5em 0;padding:0;}
|
35
|
+
p img.right {float:right;margin:1.5em 0 1.5em 1.5em;}
|
36
|
+
a:focus, a:hover {color:#000;}
|
37
|
+
a {color:#009;text-decoration:underline;}
|
38
|
+
blockquote {margin:1.5em;color:#666;font-style:italic;}
|
39
|
+
strong {font-weight:bold;}
|
40
|
+
em, dfn {font-style:italic;}
|
41
|
+
dfn {font-weight:bold;}
|
42
|
+
sup, sub {line-height:0;}
|
43
|
+
abbr, acronym {border-bottom:1px dotted #666;}
|
44
|
+
address {margin:0 0 1.5em;font-style:italic;}
|
45
|
+
del {color:#666;}
|
46
|
+
pre, code {margin:1.5em 0;white-space:pre;}
|
47
|
+
pre, code, tt {font:1em 'andale mono', 'lucida console', monospace;line-height:1.5;}
|
48
|
+
li ul, li ol {margin:0 1.5em;}
|
49
|
+
ul, ol {margin:0 1.5em 1.5em 1.5em;}
|
50
|
+
ul {list-style-type:disc;}
|
51
|
+
ol {list-style-type:decimal;}
|
52
|
+
dl {margin:0 0 1.5em 0;}
|
53
|
+
dl dt {font-weight:bold;}
|
54
|
+
dd {margin-left:1.5em;}
|
55
|
+
table {margin-bottom:1.4em;width:100%;}
|
56
|
+
th {font-weight:bold;background:#C3D9FF;}
|
57
|
+
th, td {padding:4px 10px 4px 5px;}
|
58
|
+
tr.even td {background:#E5ECF9;}
|
59
|
+
tfoot {font-style:italic;}
|
60
|
+
caption {background:#eee;}
|
61
|
+
.small {font-size:.8em;margin-bottom:1.875em;line-height:1.875em;}
|
62
|
+
.large {font-size:1.2em;line-height:2.5em;margin-bottom:1.25em;}
|
63
|
+
.hide {display:none;}
|
64
|
+
.quiet {color:#666;}
|
65
|
+
.loud {color:#000;}
|
66
|
+
.highlight {background:#ff0;}
|
67
|
+
.added {background:#060;color:#fff;}
|
68
|
+
.removed {background:#900;color:#fff;}
|
69
|
+
.first {margin-left:0;padding-left:0;}
|
70
|
+
.last {margin-right:0;padding-right:0;}
|
71
|
+
.top {margin-top:0;padding-top:0;}
|
72
|
+
.bottom {margin-bottom:0;padding-bottom:0;}
|
73
|
+
|
74
|
+
/* grid.css */
|
75
|
+
.container {width:950px;margin:0 auto;}
|
76
|
+
.showgrid {background:url(src/grid.png);}
|
77
|
+
body {margin:1.5em 0;}
|
78
|
+
div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 {float:left;margin-right:10px;}
|
79
|
+
div.last {margin-right:0;}
|
80
|
+
.span-1 {width:30px;}
|
81
|
+
.span-2 {width:70px;}
|
82
|
+
.span-3 {width:110px;}
|
83
|
+
.span-4 {width:150px;}
|
84
|
+
.span-5 {width:190px;}
|
85
|
+
.span-6 {width:230px;}
|
86
|
+
.span-7 {width:270px;}
|
87
|
+
.span-8 {width:310px;}
|
88
|
+
.span-9 {width:350px;}
|
89
|
+
.span-10 {width:390px;}
|
90
|
+
.span-11 {width:430px;}
|
91
|
+
.span-12 {width:470px;}
|
92
|
+
.span-13 {width:510px;}
|
93
|
+
.span-14 {width:550px;}
|
94
|
+
.span-15 {width:590px;}
|
95
|
+
.span-16 {width:630px;}
|
96
|
+
.span-17 {width:670px;}
|
97
|
+
.span-18 {width:710px;}
|
98
|
+
.span-19 {width:750px;}
|
99
|
+
.span-20 {width:790px;}
|
100
|
+
.span-21 {width:830px;}
|
101
|
+
.span-22 {width:870px;}
|
102
|
+
.span-23 {width:910px;}
|
103
|
+
.span-24, div.span-24 {width:950px;margin:0;}
|
104
|
+
.append-1 {padding-right:40px;}
|
105
|
+
.append-2 {padding-right:80px;}
|
106
|
+
.append-3 {padding-right:120px;}
|
107
|
+
.append-4 {padding-right:160px;}
|
108
|
+
.append-5 {padding-right:200px;}
|
109
|
+
.append-6 {padding-right:240px;}
|
110
|
+
.append-7 {padding-right:280px;}
|
111
|
+
.append-8 {padding-right:320px;}
|
112
|
+
.append-9 {padding-right:360px;}
|
113
|
+
.append-10 {padding-right:400px;}
|
114
|
+
.append-11 {padding-right:440px;}
|
115
|
+
.append-12 {padding-right:480px;}
|
116
|
+
.append-13 {padding-right:520px;}
|
117
|
+
.append-14 {padding-right:560px;}
|
118
|
+
.append-15 {padding-right:600px;}
|
119
|
+
.append-16 {padding-right:640px;}
|
120
|
+
.append-17 {padding-right:680px;}
|
121
|
+
.append-18 {padding-right:720px;}
|
122
|
+
.append-19 {padding-right:760px;}
|
123
|
+
.append-20 {padding-right:800px;}
|
124
|
+
.append-21 {padding-right:840px;}
|
125
|
+
.append-22 {padding-right:880px;}
|
126
|
+
.append-23 {padding-right:920px;}
|
127
|
+
.prepend-1 {padding-left:40px;}
|
128
|
+
.prepend-2 {padding-left:80px;}
|
129
|
+
.prepend-3 {padding-left:120px;}
|
130
|
+
.prepend-4 {padding-left:160px;}
|
131
|
+
.prepend-5 {padding-left:200px;}
|
132
|
+
.prepend-6 {padding-left:240px;}
|
133
|
+
.prepend-7 {padding-left:280px;}
|
134
|
+
.prepend-8 {padding-left:320px;}
|
135
|
+
.prepend-9 {padding-left:360px;}
|
136
|
+
.prepend-10 {padding-left:400px;}
|
137
|
+
.prepend-11 {padding-left:440px;}
|
138
|
+
.prepend-12 {padding-left:480px;}
|
139
|
+
.prepend-13 {padding-left:520px;}
|
140
|
+
.prepend-14 {padding-left:560px;}
|
141
|
+
.prepend-15 {padding-left:600px;}
|
142
|
+
.prepend-16 {padding-left:640px;}
|
143
|
+
.prepend-17 {padding-left:680px;}
|
144
|
+
.prepend-18 {padding-left:720px;}
|
145
|
+
.prepend-19 {padding-left:760px;}
|
146
|
+
.prepend-20 {padding-left:800px;}
|
147
|
+
.prepend-21 {padding-left:840px;}
|
148
|
+
.prepend-22 {padding-left:880px;}
|
149
|
+
.prepend-23 {padding-left:920px;}
|
150
|
+
div.border {padding-right:4px;margin-right:5px;border-right:1px solid #eee;}
|
151
|
+
div.colborder {padding-right:24px;margin-right:25px;border-right:1px solid #eee;}
|
152
|
+
.pull-1 {margin-left:-40px;}
|
153
|
+
.pull-2 {margin-left:-80px;}
|
154
|
+
.pull-3 {margin-left:-120px;}
|
155
|
+
.pull-4 {margin-left:-160px;}
|
156
|
+
.pull-5 {margin-left:-200px;}
|
157
|
+
.pull-6 {margin-left:-240px;}
|
158
|
+
.pull-7 {margin-left:-280px;}
|
159
|
+
.pull-8 {margin-left:-320px;}
|
160
|
+
.pull-9 {margin-left:-360px;}
|
161
|
+
.pull-10 {margin-left:-400px;}
|
162
|
+
.pull-11 {margin-left:-440px;}
|
163
|
+
.pull-12 {margin-left:-480px;}
|
164
|
+
.pull-13 {margin-left:-520px;}
|
165
|
+
.pull-14 {margin-left:-560px;}
|
166
|
+
.pull-15 {margin-left:-600px;}
|
167
|
+
.pull-16 {margin-left:-640px;}
|
168
|
+
.pull-17 {margin-left:-680px;}
|
169
|
+
.pull-18 {margin-left:-720px;}
|
170
|
+
.pull-19 {margin-left:-760px;}
|
171
|
+
.pull-20 {margin-left:-800px;}
|
172
|
+
.pull-21 {margin-left:-840px;}
|
173
|
+
.pull-22 {margin-left:-880px;}
|
174
|
+
.pull-23 {margin-left:-920px;}
|
175
|
+
.pull-24 {margin-left:-960px;}
|
176
|
+
.pull-1, .pull-2, .pull-3, .pull-4, .pull-5, .pull-6, .pull-7, .pull-8, .pull-9, .pull-10, .pull-11, .pull-12, .pull-13, .pull-14, .pull-15, .pull-16, .pull-17, .pull-18, .pull-19, .pull-20, .pull-21, .pull-22, .pull-23, .pull-24 {float:left;position:relative;}
|
177
|
+
.push-1 {margin:0 -40px 1.5em 40px;}
|
178
|
+
.push-2 {margin:0 -80px 1.5em 80px;}
|
179
|
+
.push-3 {margin:0 -120px 1.5em 120px;}
|
180
|
+
.push-4 {margin:0 -160px 1.5em 160px;}
|
181
|
+
.push-5 {margin:0 -200px 1.5em 200px;}
|
182
|
+
.push-6 {margin:0 -240px 1.5em 240px;}
|
183
|
+
.push-7 {margin:0 -280px 1.5em 280px;}
|
184
|
+
.push-8 {margin:0 -320px 1.5em 320px;}
|
185
|
+
.push-9 {margin:0 -360px 1.5em 360px;}
|
186
|
+
.push-10 {margin:0 -400px 1.5em 400px;}
|
187
|
+
.push-11 {margin:0 -440px 1.5em 440px;}
|
188
|
+
.push-12 {margin:0 -480px 1.5em 480px;}
|
189
|
+
.push-13 {margin:0 -520px 1.5em 520px;}
|
190
|
+
.push-14 {margin:0 -560px 1.5em 560px;}
|
191
|
+
.push-15 {margin:0 -600px 1.5em 600px;}
|
192
|
+
.push-16 {margin:0 -640px 1.5em 640px;}
|
193
|
+
.push-17 {margin:0 -680px 1.5em 680px;}
|
194
|
+
.push-18 {margin:0 -720px 1.5em 720px;}
|
195
|
+
.push-19 {margin:0 -760px 1.5em 760px;}
|
196
|
+
.push-20 {margin:0 -800px 1.5em 800px;}
|
197
|
+
.push-21 {margin:0 -840px 1.5em 840px;}
|
198
|
+
.push-22 {margin:0 -880px 1.5em 880px;}
|
199
|
+
.push-23 {margin:0 -920px 1.5em 920px;}
|
200
|
+
.push-24 {margin:0 -960px 1.5em 960px;}
|
201
|
+
.push-1, .push-2, .push-3, .push-4, .push-5, .push-6, .push-7, .push-8, .push-9, .push-10, .push-11, .push-12, .push-13, .push-14, .push-15, .push-16, .push-17, .push-18, .push-19, .push-20, .push-21, .push-22, .push-23, .push-24 {float:right;position:relative;}
|
202
|
+
.box {padding:1.5em;margin-bottom:1.5em;background:#E5ECF9;}
|
203
|
+
hr {background:#ddd;color:#ddd;clear:both;float:none;width:100%;height:.1em;margin:0 0 1.45em;border:none;}
|
204
|
+
hr.space {background:#fff;color:#fff;}
|
205
|
+
.clearfix:after, .container:after {content:".";display:block;height:0;clear:both;visibility:hidden;}
|
206
|
+
.clearfix, .container {display:inline-block;}
|
207
|
+
* html .clearfix, * html .container {height:1%;}
|
208
|
+
.clearfix, .container {display:block;}
|
209
|
+
.clear {clear:both;}
|
210
|
+
|
211
|
+
/* forms.css */
|
212
|
+
label {font-weight:bold;}
|
213
|
+
fieldset {padding:1.4em;margin:0 0 1.5em 0;border:1px solid #ccc;}
|
214
|
+
legend {font-weight:bold;font-size:1.2em;}
|
215
|
+
input.text, input.title, textarea, select {margin:0.5em 0;border:1px solid #bbb;}
|
216
|
+
input.text:focus, input.title:focus, textarea:focus, select:focus {border:1px solid #666;}
|
217
|
+
input.text, input.title {width:300px;padding:5px;}
|
218
|
+
input.title {font-size:1.5em;}
|
219
|
+
textarea {width:390px;height:250px;padding:5px;}
|
220
|
+
.error, .notice, .success {padding:.8em;margin-bottom:1em;border:2px solid #ddd;}
|
221
|
+
.error {background:#FBE3E4;color:#8a1f11;border-color:#FBC2C4;}
|
222
|
+
.notice {background:#FFF6BF;color:#514721;border-color:#FFD324;}
|
223
|
+
.success {background:#E6EFC2;color:#264409;border-color:#C6D880;}
|
224
|
+
.error a {color:#8a1f11;}
|
225
|
+
.notice a {color:#514721;}
|
226
|
+
.success a {color:#264409;}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
class <%= controller_class_name %>Controller < ApplicationController
|
2
|
+
def index
|
3
|
+
@<%= table_name %> = <%= class_name %>.find(:all)
|
4
|
+
end
|
5
|
+
|
6
|
+
def show
|
7
|
+
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
8
|
+
end
|
9
|
+
|
10
|
+
def new
|
11
|
+
@<%= file_name %> = <%= class_name %>.new
|
12
|
+
end
|
13
|
+
|
14
|
+
def edit
|
15
|
+
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
16
|
+
end
|
17
|
+
|
18
|
+
def create
|
19
|
+
@<%= file_name %> = <%= class_name %>.new(params[:<%= file_name %>])
|
20
|
+
|
21
|
+
if @<%= file_name %>.save
|
22
|
+
flash[:notice] = '<%= singular_name.humanize %> was successfully created.'
|
23
|
+
redirect_to(@<%= file_name %>)
|
24
|
+
else
|
25
|
+
render :action => "new"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def update
|
30
|
+
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
31
|
+
|
32
|
+
if @<%= file_name %>.update_attributes(params[:<%= file_name %>])
|
33
|
+
flash[:notice] = '<%= singular_name.humanize %> was successfully updated.'
|
34
|
+
redirect_to(@<%= file_name %>)
|
35
|
+
else
|
36
|
+
render :action => "edit"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def destroy
|
41
|
+
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
42
|
+
@<%= file_name %>.destroy
|
43
|
+
|
44
|
+
redirect_to(<%= table_name %>_url)
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<h1>Editing <%= singular_name.humanize %></h1>
|
2
|
+
|
3
|
+
<%% form_for(@<%= singular_name %>) do |form| %>
|
4
|
+
<%%= render :partial => 'form', :locals => {:form => form} %>
|
5
|
+
<p><%%= form.submit 'Update' %></p>
|
6
|
+
<%% end %>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<%%= link_to 'Show', @<%= singular_name %> %>
|
10
|
+
|
|
11
|
+
<%%= link_to 'Back', <%= plural_name %>_path %>
|
12
|
+
</p>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<h1> Listing <%= plural_name.humanize %></h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
<% for attribute in attributes -%>
|
6
|
+
<th><%= attribute.column.human_name %></th>
|
7
|
+
<% end -%>
|
8
|
+
</tr>
|
9
|
+
|
10
|
+
<%% for <%= singular_name %> in @<%= plural_name %> %>
|
11
|
+
<tr>
|
12
|
+
<% for attribute in attributes -%>
|
13
|
+
<td><%%= h <%= singular_name %>.<%= attribute.name %> %></td>
|
14
|
+
<% end -%>
|
15
|
+
<td><%%= link_to 'Show', <%= singular_name %> %></td>
|
16
|
+
<td><%%= link_to 'Edit', edit_<%= singular_name %>_path(<%= singular_name %>) %></td>
|
17
|
+
<td><%%= link_to 'Destroy', <%= singular_name %>, :confirm => 'Are you sure?', :method => :delete %></td>
|
18
|
+
</tr>
|
19
|
+
<%% end %>
|
20
|
+
</table>
|
21
|
+
|
22
|
+
<p><%%= link_to 'New <%= singular_name.humanize %>', new_<%= singular_name %>_path %></p>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%%= "#{controller.controller_name}: #{controller.action_name}" %></title>
|
5
|
+
<%%= stylesheet_link_tag 'blueprint/screen', :media => 'screen' %>
|
6
|
+
<%%= stylesheet_link_tag 'blueprint/print', :media => 'print' %>
|
7
|
+
<%%= "<!--[if IE]>#{stylesheet_link_tag 'blueprint/ie', :media => 'screen'}<![endif]-->" %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<div class="container">
|
11
|
+
<div id="content" class="column span-24">
|
12
|
+
<%% flash.each do |key, value| -%>
|
13
|
+
<div class="<%%= key %>">
|
14
|
+
<%%= h(value) %>
|
15
|
+
</div>
|
16
|
+
<%% end %>
|
17
|
+
|
18
|
+
<%%= yield %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<h1>New <%= singular_name.humanize %></h1>
|
2
|
+
|
3
|
+
<%% form_for(@<%= singular_name %>) do |form| %>
|
4
|
+
<%%= render :partial => 'form', :locals => {:form => form} %>
|
5
|
+
<p><%%= form.submit 'Create' %></p>
|
6
|
+
<%% end %>
|
7
|
+
|
8
|
+
<p><%%= link_to 'Back', <%= plural_name %>_path %></p>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<dl>
|
2
|
+
<% for attribute in attributes -%>
|
3
|
+
<dt><%= attribute.column.human_name %></dt>
|
4
|
+
<dd><%%= h @<%= singular_name %>.<%= attribute.name %> %></dd>
|
5
|
+
<% end -%>
|
6
|
+
</dl>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<%%= link_to 'Edit', edit_<%= singular_name %>_path(@<%= singular_name %>)%>
|
10
|
+
|
|
11
|
+
<%%= link_to 'Back', <%= plural_name %>_path %>
|
12
|
+
</p>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
|
3
|
+
class <%= controller_class_name %>ControllerTest < ActionController::TestCase
|
4
|
+
context 'GET to index' do
|
5
|
+
setup do
|
6
|
+
get :index
|
7
|
+
end
|
8
|
+
should_respond_with :success
|
9
|
+
should_assign_to :<%= table_name %>
|
10
|
+
end
|
11
|
+
|
12
|
+
context 'GET to new' do
|
13
|
+
setup do
|
14
|
+
get :new
|
15
|
+
end
|
16
|
+
|
17
|
+
should_respond_with :success
|
18
|
+
should_render_template :new
|
19
|
+
should_assign_to :<%= file_name %>
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'POST to create' do
|
23
|
+
setup do
|
24
|
+
post :create, :<%= file_name %> => Factory.attributes_for(:<%= file_name %>)
|
25
|
+
@<%= file_name %> = <%= class_name %>.find(:all).last
|
26
|
+
end
|
27
|
+
|
28
|
+
should_redirect_to '<%= file_name %>_path(@<%= file_name %>)'
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'GET to show' do
|
32
|
+
setup do
|
33
|
+
@<%= file_name %> = Factory(:<%= file_name %>)
|
34
|
+
get :show, :id => @<%= file_name %>.id
|
35
|
+
end
|
36
|
+
should_respond_with :success
|
37
|
+
should_render_template :show
|
38
|
+
should_assign_to :<%= file_name %>
|
39
|
+
end
|
40
|
+
|
41
|
+
context 'GET to edit' do
|
42
|
+
setup do
|
43
|
+
@<%= file_name %> = Factory(:<%= file_name %>)
|
44
|
+
get :edit, :id => @<%= file_name %>.id
|
45
|
+
end
|
46
|
+
should_respond_with :success
|
47
|
+
should_render_template :edit
|
48
|
+
should_assign_to :<%= file_name %>
|
49
|
+
end
|
50
|
+
|
51
|
+
context 'PUT to update' do
|
52
|
+
setup do
|
53
|
+
@<%= file_name %> = Factory(:<%= file_name %>)
|
54
|
+
put :update, :id => @<%= file_name %>.id, :<%= file_name %> => Factory.attributes_for(:<%= file_name %>)
|
55
|
+
end
|
56
|
+
should_redirect_to '<%= file_name %>_path(@<%= file_name %>)'
|
57
|
+
end
|
58
|
+
|
59
|
+
context 'DELETE to destroy' do
|
60
|
+
setup do
|
61
|
+
@<%= file_name %> = Factory(:<%= file_name %>)
|
62
|
+
delete :destroy, :id => @<%= file_name %>.id
|
63
|
+
end
|
64
|
+
should_redirect_to '<%= table_name %>_path'
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
|
3
|
+
class <%= controller_class_name %>ControllerTest < ActionController::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@<%= file_name %> = Factory(:<%= file_name %>)
|
7
|
+
end
|
8
|
+
|
9
|
+
should_be_restful do |resource|
|
10
|
+
resource.formats = [:html, :xml]
|
11
|
+
resource.destroy.flash = nil
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
%h1 Editing <%= singular_name.humanize %>
|
2
|
+
|
3
|
+
- form_for(@<%= singular_name %>) do |form|
|
4
|
+
= render :partial => 'form', :locals => {:form => form}
|
5
|
+
%p= form.submit 'Update'
|
6
|
+
|
7
|
+
%p
|
8
|
+
= link_to 'Show', @<%= singular_name %>
|
9
|
+
= link_to 'Back', <%= plural_name %>_path
|
@@ -0,0 +1,18 @@
|
|
1
|
+
%h1 Listing <%= plural_name.humanize %>
|
2
|
+
|
3
|
+
%table
|
4
|
+
%tr
|
5
|
+
<% for attribute in attributes -%>
|
6
|
+
%th <%= attribute.column.human_name %>
|
7
|
+
<% end -%>
|
8
|
+
|
9
|
+
- for <%= singular_name %> in @<%= plural_name %>
|
10
|
+
%tr
|
11
|
+
<% for attribute in attributes -%>
|
12
|
+
%td= h <%= singular_name %>.<%= attribute.name %>
|
13
|
+
<% end -%>
|
14
|
+
%td= link_to 'Show', <%= singular_name %>
|
15
|
+
%td= link_to 'Edit', edit_<%= singular_name %>_path(<%= singular_name %>)
|
16
|
+
%td= link_to 'Destroy', <%= singular_name %>, :confirm => 'Are you sure?', :method => :delete
|
17
|
+
|
18
|
+
%p= link_to 'New <%= singular_name.humanize %>', new_<%= singular_name %>_path
|
@@ -0,0 +1,13 @@
|
|
1
|
+
!!! Transitional
|
2
|
+
%html
|
3
|
+
%head
|
4
|
+
%title= "#{controller.controller_name}: #{controller.action_name}"
|
5
|
+
= stylesheet_link_tag 'blueprint/screen', :media => 'screen'
|
6
|
+
= stylesheet_link_tag 'blueprint/print', :media => 'print'
|
7
|
+
= "<!--[if IE]>#{stylesheet_link_tag 'blueprint/ie', :media => 'screen'}<![endif]-->"
|
8
|
+
%body
|
9
|
+
.container
|
10
|
+
#content{:class => 'column span-24'}
|
11
|
+
- flash.each do |key, value|
|
12
|
+
%div{:class => key}= h(value)
|
13
|
+
= yield
|
@@ -0,0 +1 @@
|
|
1
|
+
# Logfile created on Tue Jan 06 15:03:00 -0600 2009 by /
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stefanpenner-shoulda_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Nichols
|
@@ -87,6 +87,34 @@ files:
|
|
87
87
|
- test/shoulda_macros/generator_macros.rb
|
88
88
|
- test/stolen_from_railties.rb
|
89
89
|
- test/test_helper.rb
|
90
|
+
- rails_generators/shoulda_model/shoulda_model_generator.rb
|
91
|
+
- rails_generators/shoulda_model/templates/factory.rb
|
92
|
+
- rails_generators/shoulda_model/templates/fixtures.yml
|
93
|
+
- rails_generators/shoulda_model/templates/migration.rb
|
94
|
+
- rails_generators/shoulda_model/templates/model.rb
|
95
|
+
- rails_generators/shoulda_model/templates/unit_test.rb
|
96
|
+
- rails_generators/shoulda_model/USAGE
|
97
|
+
- rails_generators/shoulda_scaffold/shoulda_scaffold_generator.rb
|
98
|
+
- rails_generators/shoulda_scaffold/templates/blueprint/ie.css
|
99
|
+
- rails_generators/shoulda_scaffold/templates/blueprint/print.css
|
100
|
+
- rails_generators/shoulda_scaffold/templates/blueprint/screen.css
|
101
|
+
- rails_generators/shoulda_scaffold/templates/controller.rb
|
102
|
+
- rails_generators/shoulda_scaffold/templates/erb/_form.html.erb
|
103
|
+
- rails_generators/shoulda_scaffold/templates/erb/edit.html.erb
|
104
|
+
- rails_generators/shoulda_scaffold/templates/erb/index.html.erb
|
105
|
+
- rails_generators/shoulda_scaffold/templates/erb/layout.html.erb
|
106
|
+
- rails_generators/shoulda_scaffold/templates/erb/new.html.erb
|
107
|
+
- rails_generators/shoulda_scaffold/templates/erb/show.html.erb
|
108
|
+
- rails_generators/shoulda_scaffold/templates/functional_test/basic.rb
|
109
|
+
- rails_generators/shoulda_scaffold/templates/functional_test/should_be_restful.rb
|
110
|
+
- rails_generators/shoulda_scaffold/templates/haml/_form.html.haml
|
111
|
+
- rails_generators/shoulda_scaffold/templates/haml/edit.html.haml
|
112
|
+
- rails_generators/shoulda_scaffold/templates/haml/index.html.haml
|
113
|
+
- rails_generators/shoulda_scaffold/templates/haml/layout.html.haml
|
114
|
+
- rails_generators/shoulda_scaffold/templates/haml/new.html.haml
|
115
|
+
- rails_generators/shoulda_scaffold/templates/haml/show.html.haml
|
116
|
+
- rails_generators/shoulda_scaffold/templates/helper.rb
|
117
|
+
- rails_generators/shoulda_scaffold/USAGE
|
90
118
|
has_rdoc: false
|
91
119
|
homepage: http://github.com/stefanpenner/shoulda_generator
|
92
120
|
post_install_message:
|