scaffold_form_generator 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +2 -0
- data/{README.txt → README.rdoc} +0 -0
- data/scaffold_form_generator.rb +3 -2
- data/templates/form.rhtml +3 -3
- data/templates/view_edit.rhtml +4 -1
- data/templates/view_new.rhtml +4 -2
- metadata +25 -21
data/History.txt
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
==1.1.4 / 2010-06-17
|
2
|
+
* removed divs. They format poorly and you end up with invalid markup when you have error fields. Replaced with ordered lists instead. Style with CSS to make it pretty.
|
1
3
|
==1.1.3 / 2009-04-13
|
2
4
|
* fixed markup bug and changed paragraphs to divs instead so that error messages nest properly without destroying the flow / creating invalid markup.
|
3
5
|
==1.1.2 / 2009-02-13
|
data/{README.txt → README.rdoc}
RENAMED
File without changes
|
data/scaffold_form_generator.rb
CHANGED
@@ -10,7 +10,8 @@ class ScaffoldingSandbox
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def default_input_block
|
13
|
-
Proc.new { |record, column|
|
13
|
+
Proc.new { |record, column| %Q{<li><%= f.label :#{column.name} %> #{input(record, column.name)}<li>\n}
|
14
|
+
}
|
14
15
|
end
|
15
16
|
|
16
17
|
end
|
@@ -41,7 +42,7 @@ module ActionView::Helpers::ActiveRecordHelper
|
|
41
42
|
record.class.reflect_on_all_associations.each do |a|
|
42
43
|
puts a.inspect
|
43
44
|
if a.macro == :belongs_to
|
44
|
-
@results += "<
|
45
|
+
@results += "<li><label>#{a.klass}<%=f.select #{a.klass}.find(:all).collect {|i| [ p.inspect, p.id ] }, { :include_blank => true }) %></label></li>"
|
45
46
|
end
|
46
47
|
|
47
48
|
end
|
data/templates/form.rhtml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
1
|
<%%= error_messages_for '<%= singular_name %>' %>
|
2
|
-
|
3
|
-
<%= template_for_inclusion %>
|
4
|
-
|
2
|
+
<ol>
|
3
|
+
<%= template_for_inclusion %>
|
4
|
+
</ol>
|
data/templates/view_edit.rhtml
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
<h1>Editing <%= singular_name %></h1>
|
2
2
|
|
3
3
|
<%% form_for(@<%= singular_name %>) do |f| %>
|
4
|
+
|
4
5
|
<%%= render :partial => 'form' , :locals=>{:f => f}%>
|
5
|
-
|
6
|
+
<ol>
|
7
|
+
<li><%%= submit_tag 'Save' %></li>
|
8
|
+
</ol>
|
6
9
|
<%% end %>
|
7
10
|
|
8
11
|
<%%= link_to 'Show', @<%= singular_name %> %> |
|
data/templates/view_new.rhtml
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
<
|
1
|
+
<h2>New <%= singular_name %></h2>
|
2
2
|
|
3
3
|
<%% form_for(@<%= singular_name %>) do |f| %>
|
4
4
|
<%%= render :partial => 'form' , :locals=>{:f => f}%>
|
5
|
-
|
5
|
+
<ol>
|
6
|
+
<%%= submit_tag "Add" %>
|
7
|
+
</ol>
|
6
8
|
<%% end %>
|
7
9
|
|
8
10
|
<%%= link_to 'Back', <%= plural_name %>_path %>
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scaffold_form_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 1
|
8
|
+
- 4
|
9
|
+
version: 1.1.4
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Brian Hogan
|
@@ -9,30 +14,24 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2010-06-17 00:00:00 -05:00
|
13
18
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
requirements:
|
21
|
-
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 1.8.1
|
24
|
-
version:
|
25
|
-
description: Form generation for Rails models based on original scaffolding with some minor tweaks.
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: |-
|
22
|
+
Form generation for Rails models based on original scaffolding with some minor tweaks. Need to whip up a form quickly? Use this. Or use Formtastic which works better because it has better form helpers than Rails does.
|
23
|
+
|
24
|
+
Scaffolding, out of the box, is really not a good idea. You'll generate a bunch of stuff you might not use, and some of it isn't really production-worthy. However, when you stop using it, you notice that there's one part that saves you some serious time, and that's the form creation. This plugin takes code from Rails' legacy scaffold generator and makes it available again, but this time it only builds the new and edit forms.
|
26
25
|
email: info@napcs.com
|
27
26
|
executables: []
|
28
27
|
|
29
28
|
extensions: []
|
30
29
|
|
31
30
|
extra_rdoc_files:
|
32
|
-
- README.
|
31
|
+
- README.rdoc
|
33
32
|
- History.txt
|
34
33
|
files:
|
35
|
-
- README.
|
34
|
+
- README.rdoc
|
36
35
|
- History.txt
|
37
36
|
- lib/scaffold_form.rb
|
38
37
|
- scaffold_form_generator.rb
|
@@ -40,8 +39,11 @@ files:
|
|
40
39
|
- templates/form_scaffolding.rhtml
|
41
40
|
- templates/view_edit.rhtml
|
42
41
|
- templates/view_new.rhtml
|
42
|
+
- test/test_scaffold_form.rb
|
43
43
|
has_rdoc: true
|
44
|
-
homepage:
|
44
|
+
homepage:
|
45
|
+
licenses: []
|
46
|
+
|
45
47
|
post_install_message:
|
46
48
|
rdoc_options:
|
47
49
|
- --main
|
@@ -52,20 +54,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
52
54
|
requirements:
|
53
55
|
- - ">="
|
54
56
|
- !ruby/object:Gem::Version
|
57
|
+
segments:
|
58
|
+
- 0
|
55
59
|
version: "0"
|
56
|
-
version:
|
57
60
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
61
|
requirements:
|
59
62
|
- - ">="
|
60
63
|
- !ruby/object:Gem::Version
|
64
|
+
segments:
|
65
|
+
- 0
|
61
66
|
version: "0"
|
62
|
-
version:
|
63
67
|
requirements: []
|
64
68
|
|
65
69
|
rubyforge_project: scaffoldform
|
66
|
-
rubygems_version: 1.3.
|
70
|
+
rubygems_version: 1.3.6
|
67
71
|
signing_key:
|
68
|
-
specification_version:
|
72
|
+
specification_version: 3
|
69
73
|
summary: Form generation for Rails models based on original scaffolding
|
70
74
|
test_files:
|
71
75
|
- test/test_scaffold_form.rb
|