w2tags 0.9.3 → 0.9.5
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.
- data/COPYING +340 -340
- data/LICENSE +6 -6
- data/MIT-LICENSE +18 -18
- data/Manifest.txt +28 -25
- data/README.rdoc +27 -21
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/bin/w2tags +173 -143
- data/doc/History.rdoc +88 -0
- data/hot/erb.hot +18 -156
- data/hot/erb_base.hot +164 -0
- data/hot/html.hot +30 -31
- data/hot/rails/scaffold.hot +15 -15
- data/hot/vm.hot +8 -8
- data/hot/vm2.hot +34 -34
- data/hot/vm_crud.hot +34 -34
- data/hot/vm_popup.hot +74 -74
- data/lib/tags2w.rb +263 -0
- data/lib/w2tags/block/block_hot.rb +37 -0
- data/lib/w2tags/block/plain_text.rb +57 -57
- data/lib/w2tags/block/remark.rb +37 -37
- data/lib/w2tags/block/sass.rb +68 -66
- data/lib/w2tags/merb_hook.rb +15 -15
- data/lib/w2tags/parser.rb +17 -8
- data/lib/w2tags/rails_hook.rb +15 -15
- data/lib/w2tags/sinatra_hook.rb +74 -50
- data/lib/w2tags.rb +100 -100
- data/plugins/{/w2tags/ → w2tags}/README +2 -2
- data/plugins/{/w2tags//generators//w2scaffold/ → w2tags/generators/w2scaffold}/USAGE +29 -29
- data/plugins/{/w2tags//generators//w2scaffold//templates/ → w2tags/generators/w2scaffold/templates}/controller.rb +85 -85
- data/plugins/{/w2tags//generators//w2scaffold//templates/ → w2tags/generators/w2scaffold/templates}/functional_test.rb +45 -45
- data/plugins/{/w2tags//generators//w2scaffold//templates/ → w2tags/generators/w2scaffold/templates}/helper.rb +2 -2
- data/plugins/{/w2tags//generators//w2scaffold//templates/ → w2tags/generators/w2scaffold/templates}/helper_test.rb +4 -4
- data/plugins/{/w2tags//generators//w2scaffold//templates/ → w2tags/generators/w2scaffold/templates}/layout.html.erb +17 -17
- data/plugins/{/w2tags//generators//w2scaffold//templates/ → w2tags/generators/w2scaffold/templates}/style.css +54 -54
- data/plugins/{/w2tags//generators//w2scaffold//templates/ → w2tags/generators/w2scaffold/templates}/view_edit.html.erb +17 -17
- data/plugins/{/w2tags//generators//w2scaffold//templates/ → w2tags/generators/w2scaffold/templates}/view_edit.html.w2erb +16 -16
- data/plugins/{/w2tags//generators//w2scaffold//templates/ → w2tags/generators/w2scaffold/templates}/view_index.html.erb +23 -23
- data/plugins/{/w2tags//generators//w2scaffold//templates/ → w2tags/generators/w2scaffold/templates}/view_index.html.w2erb +13 -13
- data/plugins/{/w2tags//generators//w2scaffold//templates/ → w2tags/generators/w2scaffold/templates}/view_new.html.erb +16 -16
- data/plugins/{/w2tags//generators//w2scaffold//templates/ → w2tags/generators/w2scaffold/templates}/view_new.html.w2erb +15 -15
- data/plugins/{/w2tags//generators//w2scaffold//templates/ → w2tags/generators/w2scaffold/templates}/view_show.html.erb +9 -9
- data/plugins/{/w2tags//generators//w2scaffold//templates/ → w2tags/generators/w2scaffold/templates}/view_show.html.w2erb +8 -8
- data/plugins/{/w2tags//generators//w2scaffold/ → w2tags/generators/w2scaffold}/w2scaffold_generator.rb +106 -106
- data/plugins/{/w2tags/ → w2tags}/install.rb +0 -0
- data/tasks/ann.rake +81 -81
- data/tasks/bones.rake +21 -21
- data/tasks/gem.rake +126 -126
- data/tasks/git.rake +41 -41
- data/tasks/manifest.rake +49 -49
- data/tasks/notes.rake +28 -28
- data/tasks/post_load.rake +39 -39
- data/tasks/rdoc.rake +51 -51
- data/tasks/rubyforge.rake +57 -57
- data/tasks/setup.rb +268 -268
- data/tasks/spec.rake +55 -55
- data/tasks/svn.rake +48 -48
- data/tasks/test.rake +38 -38
- data/test/vars.hot +30 -30
- data/test/w2tags_basic_usability.rb +187 -187
- data/test/w2tags_enlightning.rb +42 -42
- data/test/w2tags_hot.rb +85 -85
- data/test/w2tags_hot_var.rb +115 -115
- metadata +28 -30
@@ -1,85 +1,85 @@
|
|
1
|
-
class <%= controller_class_name %>Controller < ApplicationController
|
2
|
-
# GET /<%= table_name %>
|
3
|
-
# GET /<%= table_name %>.xml
|
4
|
-
def index
|
5
|
-
@<%= table_name %> = <%= class_name %>.all
|
6
|
-
|
7
|
-
respond_to do |format|
|
8
|
-
format.html # index.html.erb
|
9
|
-
format.xml { render :xml => @<%= table_name %> }
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
# GET /<%= table_name %>/1
|
14
|
-
# GET /<%= table_name %>/1.xml
|
15
|
-
def show
|
16
|
-
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
17
|
-
|
18
|
-
respond_to do |format|
|
19
|
-
format.html # show.html.erb
|
20
|
-
format.xml { render :xml => @<%= file_name %> }
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
# GET /<%= table_name %>/new
|
25
|
-
# GET /<%= table_name %>/new.xml
|
26
|
-
def new
|
27
|
-
@<%= file_name %> = <%= class_name %>.new
|
28
|
-
|
29
|
-
respond_to do |format|
|
30
|
-
format.html # new.html.erb
|
31
|
-
format.xml { render :xml => @<%= file_name %> }
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# GET /<%= table_name %>/1/edit
|
36
|
-
def edit
|
37
|
-
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
38
|
-
end
|
39
|
-
|
40
|
-
# POST /<%= table_name %>
|
41
|
-
# POST /<%= table_name %>.xml
|
42
|
-
def create
|
43
|
-
@<%= file_name %> = <%= class_name %>.new(params[:<%= file_name %>])
|
44
|
-
|
45
|
-
respond_to do |format|
|
46
|
-
if @<%= file_name %>.save
|
47
|
-
flash[:notice] = '<%= class_name %> was successfully created.'
|
48
|
-
format.html { redirect_to(@<%= file_name %>) }
|
49
|
-
format.xml { render :xml => @<%= file_name %>, :status => :created, :location => @<%= file_name %> }
|
50
|
-
else
|
51
|
-
format.html { render :action => "new" }
|
52
|
-
format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
# PUT /<%= table_name %>/1
|
58
|
-
# PUT /<%= table_name %>/1.xml
|
59
|
-
def update
|
60
|
-
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
61
|
-
|
62
|
-
respond_to do |format|
|
63
|
-
if @<%= file_name %>.update_attributes(params[:<%= file_name %>])
|
64
|
-
flash[:notice] = '<%= class_name %> was successfully updated.'
|
65
|
-
format.html { redirect_to(@<%= file_name %>) }
|
66
|
-
format.xml { head :ok }
|
67
|
-
else
|
68
|
-
format.html { render :action => "edit" }
|
69
|
-
format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
# DELETE /<%= table_name %>/1
|
75
|
-
# DELETE /<%= table_name %>/1.xml
|
76
|
-
def destroy
|
77
|
-
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
78
|
-
@<%= file_name %>.destroy
|
79
|
-
|
80
|
-
respond_to do |format|
|
81
|
-
format.html { redirect_to(<%= table_name %>_url) }
|
82
|
-
format.xml { head :ok }
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
1
|
+
class <%= controller_class_name %>Controller < ApplicationController
|
2
|
+
# GET /<%= table_name %>
|
3
|
+
# GET /<%= table_name %>.xml
|
4
|
+
def index
|
5
|
+
@<%= table_name %> = <%= class_name %>.all
|
6
|
+
|
7
|
+
respond_to do |format|
|
8
|
+
format.html # index.html.erb
|
9
|
+
format.xml { render :xml => @<%= table_name %> }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
# GET /<%= table_name %>/1
|
14
|
+
# GET /<%= table_name %>/1.xml
|
15
|
+
def show
|
16
|
+
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
17
|
+
|
18
|
+
respond_to do |format|
|
19
|
+
format.html # show.html.erb
|
20
|
+
format.xml { render :xml => @<%= file_name %> }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# GET /<%= table_name %>/new
|
25
|
+
# GET /<%= table_name %>/new.xml
|
26
|
+
def new
|
27
|
+
@<%= file_name %> = <%= class_name %>.new
|
28
|
+
|
29
|
+
respond_to do |format|
|
30
|
+
format.html # new.html.erb
|
31
|
+
format.xml { render :xml => @<%= file_name %> }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# GET /<%= table_name %>/1/edit
|
36
|
+
def edit
|
37
|
+
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
38
|
+
end
|
39
|
+
|
40
|
+
# POST /<%= table_name %>
|
41
|
+
# POST /<%= table_name %>.xml
|
42
|
+
def create
|
43
|
+
@<%= file_name %> = <%= class_name %>.new(params[:<%= file_name %>])
|
44
|
+
|
45
|
+
respond_to do |format|
|
46
|
+
if @<%= file_name %>.save
|
47
|
+
flash[:notice] = '<%= class_name %> was successfully created.'
|
48
|
+
format.html { redirect_to(@<%= file_name %>) }
|
49
|
+
format.xml { render :xml => @<%= file_name %>, :status => :created, :location => @<%= file_name %> }
|
50
|
+
else
|
51
|
+
format.html { render :action => "new" }
|
52
|
+
format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# PUT /<%= table_name %>/1
|
58
|
+
# PUT /<%= table_name %>/1.xml
|
59
|
+
def update
|
60
|
+
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
61
|
+
|
62
|
+
respond_to do |format|
|
63
|
+
if @<%= file_name %>.update_attributes(params[:<%= file_name %>])
|
64
|
+
flash[:notice] = '<%= class_name %> was successfully updated.'
|
65
|
+
format.html { redirect_to(@<%= file_name %>) }
|
66
|
+
format.xml { head :ok }
|
67
|
+
else
|
68
|
+
format.html { render :action => "edit" }
|
69
|
+
format.xml { render :xml => @<%= file_name %>.errors, :status => :unprocessable_entity }
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# DELETE /<%= table_name %>/1
|
75
|
+
# DELETE /<%= table_name %>/1.xml
|
76
|
+
def destroy
|
77
|
+
@<%= file_name %> = <%= class_name %>.find(params[:id])
|
78
|
+
@<%= file_name %>.destroy
|
79
|
+
|
80
|
+
respond_to do |format|
|
81
|
+
format.html { redirect_to(<%= table_name %>_url) }
|
82
|
+
format.xml { head :ok }
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -1,45 +1,45 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class <%= controller_class_name %>ControllerTest < ActionController::TestCase
|
4
|
-
test "should get index" do
|
5
|
-
get :index
|
6
|
-
assert_response :success
|
7
|
-
assert_not_nil assigns(:<%= table_name %>)
|
8
|
-
end
|
9
|
-
|
10
|
-
test "should get new" do
|
11
|
-
get :new
|
12
|
-
assert_response :success
|
13
|
-
end
|
14
|
-
|
15
|
-
test "should create <%= file_name %>" do
|
16
|
-
assert_difference('<%= class_name %>.count') do
|
17
|
-
post :create, :<%= file_name %> => { }
|
18
|
-
end
|
19
|
-
|
20
|
-
assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
|
21
|
-
end
|
22
|
-
|
23
|
-
test "should show <%= file_name %>" do
|
24
|
-
get :show, :id => <%= table_name %>(:one).to_param
|
25
|
-
assert_response :success
|
26
|
-
end
|
27
|
-
|
28
|
-
test "should get edit" do
|
29
|
-
get :edit, :id => <%= table_name %>(:one).to_param
|
30
|
-
assert_response :success
|
31
|
-
end
|
32
|
-
|
33
|
-
test "should update <%= file_name %>" do
|
34
|
-
put :update, :id => <%= table_name %>(:one).to_param, :<%= file_name %> => { }
|
35
|
-
assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
|
36
|
-
end
|
37
|
-
|
38
|
-
test "should destroy <%= file_name %>" do
|
39
|
-
assert_difference('<%= class_name %>.count', -1) do
|
40
|
-
delete :destroy, :id => <%= table_name %>(:one).to_param
|
41
|
-
end
|
42
|
-
|
43
|
-
assert_redirected_to <%= table_name %>_path
|
44
|
-
end
|
45
|
-
end
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class <%= controller_class_name %>ControllerTest < ActionController::TestCase
|
4
|
+
test "should get index" do
|
5
|
+
get :index
|
6
|
+
assert_response :success
|
7
|
+
assert_not_nil assigns(:<%= table_name %>)
|
8
|
+
end
|
9
|
+
|
10
|
+
test "should get new" do
|
11
|
+
get :new
|
12
|
+
assert_response :success
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should create <%= file_name %>" do
|
16
|
+
assert_difference('<%= class_name %>.count') do
|
17
|
+
post :create, :<%= file_name %> => { }
|
18
|
+
end
|
19
|
+
|
20
|
+
assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
|
21
|
+
end
|
22
|
+
|
23
|
+
test "should show <%= file_name %>" do
|
24
|
+
get :show, :id => <%= table_name %>(:one).to_param
|
25
|
+
assert_response :success
|
26
|
+
end
|
27
|
+
|
28
|
+
test "should get edit" do
|
29
|
+
get :edit, :id => <%= table_name %>(:one).to_param
|
30
|
+
assert_response :success
|
31
|
+
end
|
32
|
+
|
33
|
+
test "should update <%= file_name %>" do
|
34
|
+
put :update, :id => <%= table_name %>(:one).to_param, :<%= file_name %> => { }
|
35
|
+
assert_redirected_to <%= file_name %>_path(assigns(:<%= file_name %>))
|
36
|
+
end
|
37
|
+
|
38
|
+
test "should destroy <%= file_name %>" do
|
39
|
+
assert_difference('<%= class_name %>.count', -1) do
|
40
|
+
delete :destroy, :id => <%= table_name %>(:one).to_param
|
41
|
+
end
|
42
|
+
|
43
|
+
assert_redirected_to <%= table_name %>_path
|
44
|
+
end
|
45
|
+
end
|
@@ -1,2 +1,2 @@
|
|
1
|
-
module <%= controller_class_name %>Helper
|
2
|
-
end
|
1
|
+
module <%= controller_class_name %>Helper
|
2
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class <%= controller_class_name %>HelperTest < ActionView::TestCase
|
4
|
-
end
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class <%= controller_class_name %>HelperTest < ActionView::TestCase
|
4
|
+
end
|
@@ -1,17 +1,17 @@
|
|
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><%= controller_class_name %>: <%%= controller.action_name %></title>
|
8
|
-
<%%= stylesheet_link_tag 'scaffold' %>
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
|
12
|
-
<p style="color: green"><%%= flash[:notice] %></p>
|
13
|
-
|
14
|
-
<%%= yield %>
|
15
|
-
|
16
|
-
</body>
|
17
|
-
</html>
|
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><%= controller_class_name %>: <%%= controller.action_name %></title>
|
8
|
+
<%%= stylesheet_link_tag 'scaffold' %>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
|
12
|
+
<p style="color: green"><%%= flash[:notice] %></p>
|
13
|
+
|
14
|
+
<%%= yield %>
|
15
|
+
|
16
|
+
</body>
|
17
|
+
</html>
|
@@ -1,54 +1,54 @@
|
|
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
|
-
.fieldWithErrors {
|
20
|
-
padding: 2px;
|
21
|
-
background-color: red;
|
22
|
-
display: table;
|
23
|
-
}
|
24
|
-
|
25
|
-
#errorExplanation {
|
26
|
-
width: 400px;
|
27
|
-
border: 2px solid red;
|
28
|
-
padding: 7px;
|
29
|
-
padding-bottom: 12px;
|
30
|
-
margin-bottom: 20px;
|
31
|
-
background-color: #f0f0f0;
|
32
|
-
}
|
33
|
-
|
34
|
-
#errorExplanation h2 {
|
35
|
-
text-align: left;
|
36
|
-
font-weight: bold;
|
37
|
-
padding: 5px 5px 5px 15px;
|
38
|
-
font-size: 12px;
|
39
|
-
margin: -7px;
|
40
|
-
background-color: #c00;
|
41
|
-
color: #fff;
|
42
|
-
}
|
43
|
-
|
44
|
-
#errorExplanation p {
|
45
|
-
color: #333;
|
46
|
-
margin-bottom: 0;
|
47
|
-
padding: 5px;
|
48
|
-
}
|
49
|
-
|
50
|
-
#errorExplanation ul li {
|
51
|
-
font-size: 12px;
|
52
|
-
list-style: square;
|
53
|
-
}
|
54
|
-
|
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
|
+
.fieldWithErrors {
|
20
|
+
padding: 2px;
|
21
|
+
background-color: red;
|
22
|
+
display: table;
|
23
|
+
}
|
24
|
+
|
25
|
+
#errorExplanation {
|
26
|
+
width: 400px;
|
27
|
+
border: 2px solid red;
|
28
|
+
padding: 7px;
|
29
|
+
padding-bottom: 12px;
|
30
|
+
margin-bottom: 20px;
|
31
|
+
background-color: #f0f0f0;
|
32
|
+
}
|
33
|
+
|
34
|
+
#errorExplanation h2 {
|
35
|
+
text-align: left;
|
36
|
+
font-weight: bold;
|
37
|
+
padding: 5px 5px 5px 15px;
|
38
|
+
font-size: 12px;
|
39
|
+
margin: -7px;
|
40
|
+
background-color: #c00;
|
41
|
+
color: #fff;
|
42
|
+
}
|
43
|
+
|
44
|
+
#errorExplanation p {
|
45
|
+
color: #333;
|
46
|
+
margin-bottom: 0;
|
47
|
+
padding: 5px;
|
48
|
+
}
|
49
|
+
|
50
|
+
#errorExplanation ul li {
|
51
|
+
font-size: 12px;
|
52
|
+
list-style: square;
|
53
|
+
}
|
54
|
+
|
@@ -1,18 +1,18 @@
|
|
1
|
-
<h1>Editing <%= singular_name %></h1>
|
2
|
-
|
3
|
-
<%% form_for(@<%= singular_name %>) do |f| %>
|
4
|
-
<%%= f.error_messages %>
|
5
|
-
|
6
|
-
<% for attribute in attributes -%>
|
7
|
-
<p>
|
8
|
-
<%%= f.label :<%= attribute.name %> %><br />
|
9
|
-
<%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
|
10
|
-
</p>
|
11
|
-
<% end -%>
|
12
|
-
<p>
|
13
|
-
<%%= f.submit 'Update' %>
|
14
|
-
</p>
|
15
|
-
<%% end %>
|
16
|
-
|
17
|
-
<%%= link_to 'Show', @<%= singular_name %> %> |
|
1
|
+
<h1>Editing <%= singular_name %></h1>
|
2
|
+
|
3
|
+
<%% form_for(@<%= singular_name %>) do |f| %>
|
4
|
+
<%%= f.error_messages %>
|
5
|
+
|
6
|
+
<% for attribute in attributes -%>
|
7
|
+
<p>
|
8
|
+
<%%= f.label :<%= attribute.name %> %><br />
|
9
|
+
<%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
|
10
|
+
</p>
|
11
|
+
<% end -%>
|
12
|
+
<p>
|
13
|
+
<%%= f.submit 'Update' %>
|
14
|
+
</p>
|
15
|
+
<%% end %>
|
16
|
+
|
17
|
+
<%%= link_to 'Show', @<%= singular_name %> %> |
|
18
18
|
<%%= link_to 'Back', <%= plural_name %>_path %>
|
@@ -1,17 +1,17 @@
|
|
1
|
-
%h1 Editing <%= singular_name %>
|
2
|
-
|
3
|
-
-- form_for(@<%= singular_name %>) do |f|
|
4
|
-
= f.error_messages
|
5
|
-
|
6
|
-
<% for attribute in attributes -%>
|
7
|
-
%p
|
8
|
-
= f.label :<%= attribute.name %>
|
9
|
-
%br
|
10
|
-
= f.<%= attribute.field_type %> :<%= attribute.name %>
|
11
|
-
<% end -%>
|
12
|
-
|
13
|
-
%p
|
14
|
-
= f.submit 'Update'
|
15
|
-
|
16
|
-
= link_to 'Show', @<%= singular_name %>
|
1
|
+
%h1 Editing <%= singular_name %>
|
2
|
+
|
3
|
+
-- form_for(@<%= singular_name %>) do |f|
|
4
|
+
= f.error_messages
|
5
|
+
|
6
|
+
<% for attribute in attributes -%>
|
7
|
+
%p
|
8
|
+
= f.label :<%= attribute.name %>
|
9
|
+
%br
|
10
|
+
= f.<%= attribute.field_type %> :<%= attribute.name %>
|
11
|
+
<% end -%>
|
12
|
+
|
13
|
+
%p
|
14
|
+
= f.submit 'Update'
|
15
|
+
|
16
|
+
= link_to 'Show', @<%= singular_name %>
|
17
17
|
= link_to 'Back', <%= plural_name %>_path
|
@@ -1,24 +1,24 @@
|
|
1
|
-
<h1>Listing <%= plural_name %></h1>
|
2
|
-
|
3
|
-
<table>
|
4
|
-
<tr>
|
5
|
-
<% for attribute in attributes -%>
|
6
|
-
<th><%= attribute.column.human_name %></th>
|
7
|
-
<% end -%>
|
8
|
-
</tr>
|
9
|
-
|
10
|
-
<%% @<%= plural_name %>.each do |<%= singular_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
|
-
<br />
|
23
|
-
|
1
|
+
<h1>Listing <%= plural_name %></h1>
|
2
|
+
|
3
|
+
<table>
|
4
|
+
<tr>
|
5
|
+
<% for attribute in attributes -%>
|
6
|
+
<th><%= attribute.column.human_name %></th>
|
7
|
+
<% end -%>
|
8
|
+
</tr>
|
9
|
+
|
10
|
+
<%% @<%= plural_name %>.each do |<%= singular_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
|
+
<br />
|
23
|
+
|
24
24
|
<%%= link_to 'New <%= singular_name %>', new_<%= singular_name %>_path %>
|
@@ -1,14 +1,14 @@
|
|
1
|
-
!hot!scaffold
|
2
|
-
%h1 Listing <%= plural_name %>
|
3
|
-
&rec=<%= singular_name %>
|
4
|
-
&fld=<%= attributes.collect {|f|f.name}.join(";") %>
|
5
|
-
%table
|
6
|
-
%tr
|
7
|
-
-th &fld!
|
8
|
-
|
9
|
-
-each_tr @<%= plural_name %>;&rec!
|
10
|
-
-td= &fld!
|
11
|
-
-td_link_crud
|
12
|
-
%br
|
13
|
-
|
1
|
+
!hot!scaffold
|
2
|
+
%h1 Listing <%= plural_name %>
|
3
|
+
&rec=<%= singular_name %>
|
4
|
+
&fld=<%= attributes.collect {|f|f.name}.join(";") %>
|
5
|
+
%table
|
6
|
+
%tr
|
7
|
+
-th &fld!
|
8
|
+
|
9
|
+
-each_tr @<%= plural_name %>;&rec!
|
10
|
+
-td= &fld!
|
11
|
+
-td_link_crud
|
12
|
+
%br
|
13
|
+
|
14
14
|
= link_to "New &rec!", new_&rec!_path
|
@@ -1,17 +1,17 @@
|
|
1
|
-
<h1>New <%= singular_name %></h1>
|
2
|
-
|
3
|
-
<%% form_for(@<%= singular_name %>) do |f| %>
|
4
|
-
<%%= f.error_messages %>
|
5
|
-
|
6
|
-
<% for attribute in attributes -%>
|
7
|
-
<p>
|
8
|
-
<%%= f.label :<%= attribute.name %> %><br />
|
9
|
-
<%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
|
10
|
-
</p>
|
11
|
-
<% end -%>
|
12
|
-
<p>
|
13
|
-
<%%= f.submit 'Create' %>
|
14
|
-
</p>
|
15
|
-
<%% end %>
|
16
|
-
|
1
|
+
<h1>New <%= singular_name %></h1>
|
2
|
+
|
3
|
+
<%% form_for(@<%= singular_name %>) do |f| %>
|
4
|
+
<%%= f.error_messages %>
|
5
|
+
|
6
|
+
<% for attribute in attributes -%>
|
7
|
+
<p>
|
8
|
+
<%%= f.label :<%= attribute.name %> %><br />
|
9
|
+
<%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
|
10
|
+
</p>
|
11
|
+
<% end -%>
|
12
|
+
<p>
|
13
|
+
<%%= f.submit 'Create' %>
|
14
|
+
</p>
|
15
|
+
<%% end %>
|
16
|
+
|
17
17
|
<%%= link_to 'Back', <%= plural_name %>_path %>
|
@@ -1,16 +1,16 @@
|
|
1
|
-
%h1 New <%= singular_name %>
|
2
|
-
|
3
|
-
-- form_for(@<%= singular_name %>) do |f|
|
4
|
-
= f.error_messages
|
5
|
-
|
6
|
-
<% for attribute in attributes -%>
|
7
|
-
%p
|
8
|
-
= f.label :<%= attribute.name %>
|
9
|
-
%br
|
10
|
-
= f.<%= attribute.field_type %> :<%= attribute.name %>
|
11
|
-
<% end -%>
|
12
|
-
|
13
|
-
%p
|
14
|
-
= f.submit 'Create'
|
15
|
-
|
1
|
+
%h1 New <%= singular_name %>
|
2
|
+
|
3
|
+
-- form_for(@<%= singular_name %>) do |f|
|
4
|
+
= f.error_messages
|
5
|
+
|
6
|
+
<% for attribute in attributes -%>
|
7
|
+
%p
|
8
|
+
= f.label :<%= attribute.name %>
|
9
|
+
%br
|
10
|
+
= f.<%= attribute.field_type %> :<%= attribute.name %>
|
11
|
+
<% end -%>
|
12
|
+
|
13
|
+
%p
|
14
|
+
= f.submit 'Create'
|
15
|
+
|
16
16
|
= link_to 'Back', <%= plural_name %>_path
|
@@ -1,10 +1,10 @@
|
|
1
|
-
<% for attribute in attributes -%>
|
2
|
-
<p>
|
3
|
-
<b><%= attribute.column.human_name %>:</b>
|
4
|
-
<%%=h @<%= singular_name %>.<%= attribute.name %> %>
|
5
|
-
</p>
|
6
|
-
|
7
|
-
<% end -%>
|
8
|
-
|
9
|
-
<%%= link_to 'Edit', edit_<%= singular_name %>_path(@<%= singular_name %>) %> |
|
1
|
+
<% for attribute in attributes -%>
|
2
|
+
<p>
|
3
|
+
<b><%= attribute.column.human_name %>:</b>
|
4
|
+
<%%=h @<%= singular_name %>.<%= attribute.name %> %>
|
5
|
+
</p>
|
6
|
+
|
7
|
+
<% end -%>
|
8
|
+
|
9
|
+
<%%= link_to 'Edit', edit_<%= singular_name %>_path(@<%= singular_name %>) %> |
|
10
10
|
<%%= link_to 'Back', <%= plural_name %>_path %>
|